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): a template that cannot boot a game does not become a release

esengine13dfcc5d8575
diff --git a/.github/workflows/native-smoke.yml b/.github/workflows/native-smoke.yml
index ca668e77d..c36b0d839 100644
--- a/.github/workflows/native-smoke.yml
+++ b/.github/workflows/native-smoke.yml
@@ -31,6 +31,7 @@ on:
inputs:
template-tag:
required: false
+ default: ''
type: string
example:
required: false
@@ -50,16 +51,31 @@ jobs:
- uses: ./.github/actions/setup
+ # Called from the release pipeline the templates are this run's artifacts;
+ # run by hand there are none, so a blank tag means the newest release rather
+ # than a download that fails saying nothing was uploaded.
+ - name: Decide where the template comes from
+ id: src
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: ${{ inputs.template-tag }}
+ run: |
+ if [ -z "$TAG" ] && [ "$GITHUB_EVENT_NAME" = 'workflow_dispatch' ]; then
+ TAG=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName)
+ echo "no tag given — taking the templates from the latest release, $TAG"
+ fi
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
+
- name: Take the template from the release
- if: inputs.template-tag != ''
+ if: steps.src.outputs.tag != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- gh release download "${{ inputs.template-tag }}" --repo "$GITHUB_REPOSITORY" \
+ gh release download "${{ steps.src.outputs.tag }}" --repo "$GITHUB_REPOSITORY" \
-p 'estella-native-android-*.zip' -D templates
- name: Take the template from this run
- if: inputs.template-tag == ''
+ if: steps.src.outputs.tag == ''
uses: actions/download-artifact@v8
with:
name: native-template-android
@@ -119,16 +135,28 @@ jobs:
- uses: ./.github/actions/setup
+ - name: Decide where the template comes from
+ id: src
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: ${{ inputs.template-tag }}
+ run: |
+ if [ -z "$TAG" ] && [ "$GITHUB_EVENT_NAME" = 'workflow_dispatch' ]; then
+ TAG=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName)
+ echo "no tag given — taking the templates from the latest release, $TAG"
+ fi
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
+
- name: Take the template from the release
- if: inputs.template-tag != ''
+ if: steps.src.outputs.tag != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- gh release download "${{ inputs.template-tag }}" --repo "$GITHUB_REPOSITORY" \
+ gh release download "${{ steps.src.outputs.tag }}" --repo "$GITHUB_REPOSITORY" \
-p 'estella-native-ios-*.zip' -D templates
- name: Take the template from this run
- if: inputs.template-tag == ''
+ if: steps.src.outputs.tag == ''
uses: actions/download-artifact@v8
with:
name: native-template-ios
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index 06c97a1de..2740c10c1 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -227,6 +227,16 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "$GITHUB_REF_NAME" artifacts/* --repo "$GITHUB_REPOSITORY" --clobber
+ # Completeness is not the same as working. The archives this run just built are
+ # packaged around a real example and started on an emulator and a simulator, so
+ # a template that produces an app which dies — or draws nothing, which is how
+ # v0.36.0 reached players — cannot become a release.
+ smoke:
+ needs: [draft, native-templates]
+ if: github.event_name == 'push' && needs.native-templates.result == 'success'
+ uses: ./.github/workflows/native-smoke.yml
+ secrets: inherit
+
release:
# Platform jobs only package: SDK + renderer builds are quick TS/JS work,
# and electron-builder needs the native OS. No emsdk, no C++ here.
@@ -368,11 +378,12 @@ jobs:
# `release: published`, when the assets are final and downloadable by tag.
publish:
name: Publish the release
- needs: [draft, release, publish-templates]
+ needs: [draft, release, publish-templates, smoke]
if: >-
github.event_name == 'push' &&
needs.release.result == 'success' &&
- needs.publish-templates.result == 'success'
+ needs.publish-templates.result == 'success' &&
+ needs.smoke.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions: