ci(workflows): build and deploy via GitHub Actions#48
Merged
Conversation
Compile the game from sources on every push to master and publish the result to GitHub Pages, so translation PRs no longer require contributors to compile the game locally. The pipeline mirrors compile.sh: generate genAscii.ts/genText.ts with the existing python scripts, compile with TypeScript 1.7.5 (the last release that accepts the 2013-era 'this in super arguments' pattern used by the code base), minify with terser and prepend the license. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
candybox2.js, candybox2_uncompressed.js and code/gen/* are now built and deployed by the GitHub Actions workflow. The committed copies were already stale: code/gen/genText.ts did not include the recently merged Italian translation. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
candybox2.js,candybox2_uncompressed.js,code/gen/*) from the repositoryWhy
Until now the compiled JavaScript had to be built locally and committed, which required a 2013-era toolchain (old tsc + yuicompressor). In practice this meant translation PRs (e.g. #46) had no effect on the live site until someone rebuilt the game, and contributors could not compile it at all: TypeScript 1.8+ rejects the
this-in-super()-arguments pattern used throughout the code base (TS17009). The committedcode/gen/genText.tswas already stale.How it works
The workflow mirrors
compile.sh:genAscii.py/genText.pygeneratecode/gen/*.tsfromascii/andtext/candybox2.jsandcandybox2_uncompressed.jsThe built game was verified locally in a browser: it loads, runs without console errors, and the Italian translation from #46 is selectable.
Notes
configure-pagesstep does this on the first run; switching it before merging avoids the legacy branch build briefly publishing a site withoutcandybox2.js)compile.shis kept untouched for local builds