fix(release): publish via gh cli with clobber upload

This commit is contained in:
2026-03-02 03:00:06 -08:00
parent be4db24861
commit f0bd0ba355

View File

@@ -278,11 +278,13 @@ jobs:
echo "$CHANGES" >> $GITHUB_OUTPUT echo "$CHANGES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release - name: Publish Release
uses: softprops/action-gh-release@v2 env:
with: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.version.outputs.VERSION }} run: |
body: | set -euo pipefail
cat > release-body.md <<'EOF'
## Changes ## Changes
${{ steps.changelog.outputs.CHANGES }} ${{ steps.changelog.outputs.CHANGES }}
@@ -311,12 +313,35 @@ jobs:
- macOS: `~/Library/Application Support/SubMiner/themes/subminer.rasi` - macOS: `~/Library/Application Support/SubMiner/themes/subminer.rasi`
Note: the `subminer` wrapper script uses Bun (`#!/usr/bin/env bun`), so `bun` must be installed and on `PATH`. Note: the `subminer` wrapper script uses Bun (`#!/usr/bin/env bun`), so `bun` must be installed and on `PATH`.
files: | EOF
if gh release view "${{ steps.version.outputs.VERSION }}" >/dev/null 2>&1; then
gh release edit "${{ steps.version.outputs.VERSION }}" \
--title "${{ steps.version.outputs.VERSION }}" \
--notes-file release-body.md \
--prerelease false
else
gh release create "${{ steps.version.outputs.VERSION }}" \
--title "${{ steps.version.outputs.VERSION }}" \
--notes-file release-body.md \
--prerelease false
fi
shopt -s nullglob
artifacts=(
release/*.AppImage release/*.AppImage
release/*.dmg release/*.dmg
release/*.zip release/*.zip
release/*.tar.gz release/*.tar.gz
release/SHA256SUMS.txt release/SHA256SUMS.txt
dist/launcher/subminer dist/launcher/subminer
draft: false )
prerelease: false
if [ "${#artifacts[@]}" -eq 0 ]; then
echo "No release artifacts found for upload."
exit 1
fi
for asset in "${artifacts[@]}"; do
gh release upload "${{ steps.version.outputs.VERSION }}" "$asset" --clobber
done