Skip to content

Commit

Permalink
handle prerelease tags
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdfly committed Apr 27, 2024
1 parent a798e0a commit f36f7c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} release ${tag#v}" \
--generate-notes
run: ./scripts/gh_release.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Or a prerelease with:

`scripts/bump_version.sh prerel`

The release and notes will be created automatically via Github Actions.
The release and notes will be created automatically via Github Actions. Follow along in: https://github.com/superfly/fly-go/actions/workflows/release.yml
13 changes: 13 additions & 0 deletions scripts/gh_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail
if [[ "$tag" == *"-pre-"* ]]
then
prerelease="--prerelease"
else
prerelease=""
fi
gh release create "$tag" \
$prerelease \
--repo="$GITHUB_REPOSITORY" \
--title="${tag}" \
--generate-notes

0 comments on commit f36f7c5

Please sign in to comment.