icebear0828 commited on
Commit
dd4a13a
·
1 Parent(s): 11b0259

fix: use --publish never + manual upload for macOS x64 build

Browse files

electron-builder's publisher tries to manage ALL release assets during
upload, causing 422 conflicts when arm64 assets already exist. x64 now
builds with --publish never and manually uploads only its own artifacts.

Files changed (1) hide show
  1. .github/workflows/release.yml +13 -13
.github/workflows/release.yml CHANGED
@@ -145,25 +145,25 @@ jobs:
145
  working-directory: packages/electron
146
  run: node electron/prepare-pack.mjs
147
 
148
- - name: Clean stale release assets
149
- continue-on-error: true
 
 
 
150
  run: |
151
  TAG="${{ inputs.tag || github.ref_name }}"
152
- ASSETS=$(gh release view "$TAG" --json assets -q '.assets[].name' 2>/dev/null || echo "")
153
- [ -z "$ASSETS" ] && exit 0
154
- echo "$ASSETS" | grep -iE "x64" | while read -r name; do
155
- echo "Removing stale asset: $name"
156
- gh release delete-asset "$TAG" "$name" -y 2>/dev/null || true
 
 
 
157
  done
158
  env:
159
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160
 
161
- - name: Pack (mac-x64)
162
- working-directory: packages/electron
163
- run: npx electron-builder --config electron-builder.yml --mac --x64 --publish always
164
- env:
165
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166
-
167
  release:
168
  needs: [build, build-mac-x64]
169
  runs-on: ubuntu-latest
 
145
  working-directory: packages/electron
146
  run: node electron/prepare-pack.mjs
147
 
148
+ - name: Pack (mac-x64)
149
+ working-directory: packages/electron
150
+ run: npx electron-builder --config electron-builder.yml --mac --x64 --publish never
151
+
152
+ - name: Upload x64 artifacts to release
153
  run: |
154
  TAG="${{ inputs.tag || github.ref_name }}"
155
+ cd packages/electron/release
156
+ for f in *; do
157
+ [ -f "$f" ] || continue
158
+ # Skip arm64 files and yml manifests (arm64 build already uploaded these)
159
+ echo "$f" | grep -qi "arm64" && continue
160
+ echo "$f" | grep -qiE "\.yml$" && continue
161
+ echo "Uploading: $f"
162
+ gh release upload "$TAG" "$f" --clobber 2>/dev/null || true
163
  done
164
  env:
165
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166
 
 
 
 
 
 
 
167
  release:
168
  needs: [build, build-mac-x64]
169
  runs-on: ubuntu-latest