This commit is contained in:
Kevin Yue 2024-04-02 20:48:25 +08:00
parent cec0d22dc8
commit 7c6ae315e1

View File

@ -155,9 +155,10 @@ jobs:
gpgui-source/*.bin.tar.xz.sha256
gh-release:
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/dev'
if: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs:
- tarball
- build-gp
- build-gpgui
@ -172,12 +173,14 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
RELEASE_TAG: ${{ github.ref == 'refs/heads/dev' && 'snapshot' || github.ref_name }}
REPO: ${{ github.repository }}
NOTES: ${{ github.ref == 'refs/heads/dev' && '**!!! DO NOT USE THIS RELEASE IN PRODUCTION !!!**' || format('Release {0}', github.ref_name) }}
run: |
gh release delete $RELEASE_TAG --yes --cleanup-tag || true
gh release create $RELEASE_TAG \
gh -R "$REPO" release delete $RELEASE_TAG --yes --cleanup-tag || true
gh -R "$REPO" release create $RELEASE_TAG \
--title "$RELEASE_TAG" \
--notes "Release $RELEASE_TAG" \
--target ${{ github.ref}} \
--notes "$NOTES" \
--target ${{ github.ref }} \
${{ github.ref == 'refs/heads/dev' && '--prerelease' || '' }} \
"gh-release/artifact-source/*" \
"gh-release/artifact-gpgui-*/*"
gh-release/artifact-source/* \
gh-release/artifact-gpgui-*/*