Skip to content

Commit

Permalink
GITHUB: workflows/release.yml: set prerelease:false for annotated tags
Browse files Browse the repository at this point in the history
Fix actions/checkout@v3 and actions/checkout@v4 messing up the annotation of
the currently fetched tag, even with fetch-depth:0, see: actions/checkout#290

Signed-off-by: Tim Janik <timj@gnu.org>
  • Loading branch information
tim-janik committed Sep 6, 2023
1 parent 9dfb091 commit ea5b283
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ jobs:
Release-Build-and-Upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Fetch Repository Tags
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch history and all (annotated) tags
- name: Fetch Tag
id: fetchtag
run: |
git fetch -f --tags # Fix actions/checkout messing up annotation of the fetched tag: actions/checkout#290
echo "ISPRERELEASE=$(test tag != $(git cat-file -t $GITHUB_REF_NAME) && echo true || echo false)" >> "$GITHUB_OUTPUT"
misc/version.sh
git fetch --unshallow
git describe --tags --exact-match 2>/dev/null || git describe
git cat-file -t $GITHUB_REF_NAME
Expand All @@ -38,7 +41,7 @@ jobs:
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
prerelease: ${{ steps.fetchtag.outputs.ISPRERELEASE }}
files: assets/*
body_path: assets.txt

Expand Down

0 comments on commit ea5b283

Please sign in to comment.