Skip to content

Commit 63cdb93

Browse files
facontidavideclaude
andcommitted
Fix CI release race: use gh CLI + || true for idempotent creates
- appimage.yaml: replace per-job softprops/action-gh-release with single release job using gh CLI (eliminates intra-workflow race) - release-debs.yaml: replace softprops/action-gh-release with gh CLI, remove dead "Determine release tag" step and debugging noise - Both workflows: add || true after gh release create to handle cross-workflow race (two workflows creating the same release) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: ae53f25e11a4
1 parent 6672f73 commit 63cdb93

2 files changed

Lines changed: 34 additions & 32 deletions

File tree

.github/workflows/appimage.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,27 @@ jobs:
114114
name: appimage-${{ matrix.environment }}
115115
path: "*.AppImage"
116116

117-
- name: Upload to GitHub Release
118-
if: startsWith(github.ref, 'refs/tags/')
119-
uses: softprops/action-gh-release@v2
117+
release:
118+
needs: appimage
119+
if: startsWith(github.ref, 'refs/tags/')
120+
runs-on: ubuntu-latest
121+
permissions:
122+
contents: write
123+
steps:
124+
- uses: actions/download-artifact@v4
120125
with:
121-
tag_name: ${{ github.ref_name }}
122-
files: "*.AppImage"
126+
path: artifacts
127+
pattern: appimage-*
128+
merge-multiple: true
129+
130+
- name: Upload to GitHub Release
131+
env:
132+
GH_TOKEN: ${{ github.token }}
133+
GH_REPO: ${{ github.repository }}
134+
run: |
135+
tag="${{ github.ref_name }}"
136+
# Create release if it doesn't exist yet
137+
gh release view "$tag" >/dev/null 2>&1 || \
138+
gh release create "$tag" --title "$tag" --generate-notes || true
139+
# Upload assets (--clobber overwrites if re-run)
140+
gh release upload "$tag" artifacts/*.AppImage --clobber

.github/workflows/release-debs.yaml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,37 +100,21 @@ jobs:
100100
contents: write
101101

102102
steps:
103-
- uses: actions/checkout@v4
104-
with:
105-
fetch-depth: 0
106-
107-
- name: Determine release tag
108-
id: tag
109-
run: |
110-
if [[ "${{ github.ref_type }}" == "tag" ]]; then
111-
echo "name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
112-
echo "prerelease=false" >> "$GITHUB_OUTPUT"
113-
else
114-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
115-
echo "name=${LATEST_TAG}-dev" >> "$GITHUB_OUTPUT"
116-
echo "prerelease=true" >> "$GITHUB_OUTPUT"
117-
fi
118-
119103
- name: Download all deb artifacts
120104
uses: actions/download-artifact@v4
121105
with:
122106
path: debs
123107
pattern: deb-*
124108
merge-multiple: true
125109

126-
- name: List artifacts
127-
run: ls -lh debs/
128-
129-
- name: Create GitHub Release
130-
uses: softprops/action-gh-release@v2
131-
with:
132-
tag_name: ${{ steps.tag.outputs.name }}
133-
name: ${{ steps.tag.outputs.name }}
134-
prerelease: ${{ steps.tag.outputs.prerelease }}
135-
generate_release_notes: true
136-
files: debs/*.deb
110+
- name: Upload to GitHub Release
111+
env:
112+
GH_TOKEN: ${{ github.token }}
113+
GH_REPO: ${{ github.repository }}
114+
run: |
115+
tag="${{ github.ref_name }}"
116+
# Create release if it doesn't exist yet
117+
gh release view "$tag" >/dev/null 2>&1 || \
118+
gh release create "$tag" --title "$tag" --generate-notes || true
119+
# Upload assets (--clobber overwrites if re-run)
120+
gh release upload "$tag" debs/*.deb --clobber

0 commit comments

Comments
 (0)