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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(gate): the android criterion had no template, and said so 47 times in silence
esengine12c6879318ed
diff --git a/.github/actions/native-template/action.yml b/.github/actions/native-template/action.ymlnew file mode 100644index 000000000..0e9443e38--- /dev/null+++ b/.github/actions/native-template/action.yml@@ -0,0 +1,51 @@+name: Runtime template from a release+description: Download and unpack a published native runtime template into template/.++# What a game is packaged INTO. verify-native-boot defaults to <root>/template,+# which a plain checkout does not have — and unchecked, every one of 47 exports+# failed with an empty reason before it learned to say so.+#+# The RELEASE template on purpose, not this branch's: building one costs ~40+# minutes, which a nightly cannot pay daily. What that answers is the half a+# creator lives in — today's game content on the host they already installed.+# HEAD's own template is native-smoke's question, and the release pipeline calls+# it. Two halves, not two copies.++inputs:+ platform:+ description: android or ios.+ required: true+ tag:+ description: Release tag to take it from (blank = the latest release).+ required: false+ default: ''+ token:+ description: Token for `gh release download`.+ required: true++runs:+ using: composite+ steps:+ - name: Take the template from the release+ shell: bash+ env:+ GH_TOKEN: ${{ inputs.token }}+ TAG: ${{ inputs.tag }}+ PLATFORM: ${{ inputs.platform }}+ run: |+ set -euo pipefail+ if [ -z "$TAG" ]; then+ TAG=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName)+ echo "no tag given — taking the $PLATFORM template from $TAG"+ fi+ gh release download "$TAG" --repo "$GITHUB_REPOSITORY" \+ -p "estella-native-$PLATFORM-*.zip" -D templates+ # Under release strictness, so nothing is packaged around an archive the+ # publish gate would reject anyway.+ node build-tools/cli.js verify-template templates/*.zip+ mkdir -p template+ unzip -q templates/*.zip -d template+ # `mkdir -p` already made the directory, so its existence proves nothing;+ # what the next step needs is that the archive put something in it.+ [ -n "$(ls -A template)" ] || { echo "::error::$PLATFORM template unpacked to nothing"; exit 1; }+ echo "unpacked $(ls templates) into template/ ($(ls -A template | wc -l) entries)"diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.ymlindex de36806a1..b5c418d03 100644--- a/.github/workflows/nightly.yml+++ b/.github/workflows/nightly.yml@@ -14,6 +14,9 @@ name: Nightly# A release tag runs the same thing: an exit criterion is what a RELEASE has to# be able to say, so the list is answered again against the commit being shipped# rather than trusted from whatever the cron last saw.+permissions:+ contents: read+on:schedule:# 04:00 UTC, after the day's pushes have settled.@@ -147,6 +150,14 @@ jobs:with:version: 5.0.0+ # A game is packaged INTO a template, and this job never had one: the default+ # path is a directory a checkout does not carry, so all 47 exports failed at+ # once. The action's own comment says why this takes the released one.+ - uses: ./.github/actions/native-template+ with:+ platform: android+ token: ${{ secrets.GITHUB_TOKEN }}+# Nested virtualisation for the emulator, as the compat matrix does.- name: Enable KVMrun: |diff --git a/tools/releaseGate.mjs b/tools/releaseGate.mjsindex 26006d91a..3de662e18 100644--- a/tools/releaseGate.mjs+++ b/tools/releaseGate.mjs@@ -61,7 +61,7 @@ export const CRITERIA = [{id: '3d-runs-where-it-ships',host: 'android',- why: 'the same emulator boot, for the 3D corpus',+ why: 'the same emulator boot, for the 3D corpus — nightly answers it against the RELEASED template, which is the host a creator already has; HEAD\'s own template costs 40 minutes to build and is native-smoke\'s question, asked by the release pipeline',says: 'a game whose world is 3D boots and draws on a device',// The web half is golden-packages' own command, and was run twice for one// verdict. Only an emulator answers this: a solver that never compiled intodiff --git a/tools/verify-native-boot.mjs b/tools/verify-native-boot.mjsindex 0a4f3c151..b6674853b 100644--- a/tools/verify-native-boot.mjs+++ b/tools/verify-native-boot.mjs@@ -751,6 +751,17 @@ function packageExample(driver, name, opts) {const opts = parseArgs(process.argv.slice(2));const driver = opts.platform === 'ios' ? iosDriver(opts) : androidDriver(opts);++// The template is what a game is packaged INTO, and its default is a directory a+// plain checkout does not have. Unchecked, every export failed with an empty+// reason: 47 examples, one after another, six minutes to say nothing.+if (!existsSync(opts.template)) {+ console.error(`✗ no ${driver.name} runtime template at ${path.relative(ROOT, opts.template)}`);+ console.error(' take one from a release (as native-smoke does) or build it:'+ + ` node build-tools/cli.js native --target ${driver.name}`);+ process.exit(2);+}+mkdirSync(opts.out, { recursive: true });let device;