Check if release tag exists before blindly creating/overriding

This commit is contained in:
tooomm 2026-09-26 21:00:21 +02:00 • committed by GitHub
parent 26a74c96c5
commit 500a34c2d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,13 +85,17 @@ jobs:
body_path: ${{ steps.prepare.outputs.body_path }} body_path: ${{ steps.prepare.outputs.body_path }}
prerelease: ${{ steps.prepare.outputs.is_beta }} prerelease: ${{ steps.prepare.outputs.is_beta }}
run: | run: |
args=() if gh release view "$tag_name" >/dev/null 2>&1; then
[[ $prerelease == yes ]] && args+=(--prerelease) echo "::warning::Release $tag_name already exists"
else
args=()
[[ $prerelease == yes ]] && args+=(--prerelease)
gh release create "$tag_name" --verify-tag --draft "${args[@]}" \ gh release create "$tag_name" --verify-tag --draft "${args[@]}" \
--target "$target" \ --target "$target" \
--title "$release_name" \ --title "$release_name" \
--notes-file "$body_path" --notes-file "$body_path"
fi
build-linux: build-linux:
strategy: strategy:
@ -356,7 +360,7 @@ jobs:
with: with:
msbuild-architecture: x64 msbuild-architecture: x64
- name: "[macOS] Setup ccache" - name: "[macOS] Install ccache"
if: matrix.os == 'macOS' && matrix.use_ccache == 1 if: matrix.os == 'macOS' && matrix.use_ccache == 1
run: brew install ccache run: brew install ccache