Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

ci(release): pre-create the draft — platforms upload in parallel

esengine81e0f0948264
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index 606a4947e..3e3ab0f4d 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -6,14 +6,30 @@ on:
- 'v*'
jobs:
+ # The single writer that creates the draft release. electron-builder's GitHub
+ # publisher creates a draft lazily when none exists, so parallel platform
+ # jobs used to race and produce duplicate drafts with the artifacts split
+ # between them (it even recurred under max-parallel: 1). With the draft
+ # pre-created here, every platform finds it and uploads into it — safe to
+ # run in parallel.
+ draft:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - name: Create the draft release up front
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 || \
+ gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" \
+ --draft --title "$GITHUB_REF_NAME" \
+ --notes "See CHANGELOG.md for this release's notes."
+
release:
+ needs: draft
strategy:
fail-fast: false
- # Serialize the platforms: electron-builder's GitHub publisher creates the draft
- # release lazily, so running all three in parallel races and produces duplicate
- # drafts with the artifacts split between them. With one at a time, the first job
- # creates the draft and the rest find and upload to it.
- max-parallel: 1
# Windows + macOS only — the Linux AppImage is dropped from releases
# until there is real demand for it.
matrix: