add version check #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build 🏗️ and Publish 📦️ | ||
on: | ||
push: | ||
tags: ['*'] | ||
jobs: | ||
version-check: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Fetch repo | ||
uses: actions/checkout@v4 | ||
#with: | ||
#fetch-depth: 0 | ||
- name: Check if we are on correct commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
REL_VERSION=v$(./quickemu --version) | ||
GIT_VERSION=$(git describe --tags) | ||
echo "Release version ${REL_VERSION}" | ||
echo "Git tag version ${GIT_VERSION}" | ||
if [ "${REL_VERSION}" != "${GIT_VERSION}" ]; then \ | ||
echo "This is probably not what you want"; \ | ||
exit 1; \ | ||
fi | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create release ${{ github.ref }} as a draft | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN } | ||
Check failure on line 36 in .github/workflows/publish-release.yml GitHub Actions / Build 🏗️ and Publish 📦️Invalid workflow file
|
||
run: | | ||
gh release create "${{ github.ref }}" --draft --generate-notes | ||
build-release: | ||
needs: [create-release] | ||
name: Build Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build and Upload .deb | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
sudo apt-get -y update | ||
sudo apt-get -y install debhelper devscripts | ||
REL_VER=$(grep "^readonly VERSION" quickemu | cut -d'"' -f2) | ||
rm debian/changelog | ||
dch --package quickemu --newversion="${REL_VER}-1" --distribution=unstable "New upstream release." --create | ||
dpkg-buildpackage --build=binary --no-check-builddeps --compression=gzip | ||
gh release upload "${{ github.ref }}" "../quickemu_${REL_VER}-1_all.deb" --clobber | ||
publish-release: | ||
needs: [build-release] | ||
name: Publish Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish release ${{ github.ref }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ "$(gh release view "${{ github.ref }}" --json assets --template '{{len .assets}}')" -lt 0 ]; then | ||
exit 1 | ||
fi | ||
gh release edit "${{ github.ref }}" --draft=false |