From 316d605f1f8f7a31f619c20479e2ac5a28868f75 Mon Sep 17 00:00:00 2001 From: leftibot Date: Sat, 11 Apr 2026 15:46:42 -0600 Subject: [PATCH] Address review: publish WASM assets as release under wasm-latest tag Add a publish job to the emscripten workflow that creates a prerelease tagged wasm-latest with chaiscript.js, chaiscript.wasm, and chaiscript.html as downloadable assets. Runs only on pushes to the develop branch. The website repo can fetch these via the public GitHub Releases API on a daily cron without any cross-repo auth. Requested by @lefticus in PR #662 review. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/emscripten.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 1289951e..4be8931f 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -40,3 +40,32 @@ jobs: build-em/chaiscript.wasm build-em/chaiscript.html retention-days: 90 + + publish: + name: Publish WASM Release + needs: emscripten + if: github.ref == 'refs/heads/develop' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + name: chaiscript-web + path: artifacts + + - name: Publish to wasm-latest release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Flatten: artifacts may contain build-em/ subdirectory + find artifacts -type f \( -name 'chaiscript.js' -o -name 'chaiscript.wasm' -o -name 'chaiscript.html' \) -exec cp {} . \; + + # Delete existing release if present, then recreate + gh release delete wasm-latest --repo "$GITHUB_REPOSITORY" -y 2>/dev/null || true + gh release create wasm-latest \ + --repo "$GITHUB_REPOSITORY" \ + --title "ChaiScript WASM Build (latest)" \ + --notes "Auto-published from develop branch. Built with Emscripten for browser use." \ + --prerelease \ + chaiscript.js chaiscript.wasm chaiscript.html