Skip to content

Commit

Permalink
ci(release): add check for prereleases
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccs committed Apr 18, 2024
1 parent 60dd509 commit 0de2754
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@ jobs:

- name: Release on GitHub
run: |
gh release create \
$(git describe --tags --abbrev=0) -t $(git describe --tags --abbrev=0) \
--target main --generate-notes \
firewall/cerbero
latest_tag=$(git describe --tags --abbrev=0)
is_prerelease=false
release_attachments="firewall/cerbero"
if [[ $latest_tag == *"alpha"* || $latest_tag == *"beta"* ]]; then
is_prerelease=true
fi
command="gh release create $(git describe --tags --abbrev=0) -t $(git describe --tags --abbrev=0) --target main --generate-notes"
if [ $is_prerelease = true ]; then
command="$command --prerelease"
fi
command="$command $release_attachments"
$command
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_TOKEN }} # A custom token is needed to chain workflows after this one (e.g. docker builds)

0 comments on commit 0de2754

Please sign in to comment.