6 Commits
Author SHA1 Message Date
valknarandClaude Sonnet 5 ad66bbf6be Rename package from @valknar/vpinball-wasm to vpinball-wasm
CI / Build wasm engine (push) Successful in 9m32s
Unscoped, matching this project's other Gitea-published package
(triggershell) - the registry is already scoped to the right owner via
publishConfig.registry's URL path (.../valknar/npm/), so an npm scope
on the package name itself is redundant. The old @valknar/vpinball-wasm
package published under the previous name is being removed manually.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 19:06:44 +02:00
valknarandClaude Sonnet 5 243c975cec Merge build and publish into one job, eliminating redundant CI builds
CI / Build wasm engine (push) Successful in 9m24s
The separate "publish" job had needs: build but never reused any of
build's output - it re-ran the entire checkout/cache/setup/build-deps/
build/wrapper pipeline from scratch, so every tagged release did two
full independent builds for no benefit. Gitea Actions doesn't support
upload-artifact@v4+/download-artifact@v4+ (GHESNotSupportedError),
which rules out the usual "build uploads, publish downloads" pattern
anyway, so the simplest fix is to run the build pipeline exactly once
and gate the three publish-only steps (version bump from tag, registry
auth, npm publish) behind `if: startsWith(github.ref, 'refs/tags/')`
at the step level instead of duplicating everything in a second job.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 18:50:12 +02:00
valknarandClaude Sonnet 5 536e09dff4 Bump version to 0.1.0 for the first release
CI / Build wasm engine (push) Successful in 9m17s
CI / Publish to npm registry (push) Canceled after 3m47s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 18:36:26 +02:00
valknarandClaude Sonnet 5 d22dc28af3 Fix CI: drop upload-artifact (unsupported on Gitea, unused downstream)
CI / Publish to npm registry (push) Canceled after 0s
CI / Build wasm engine (push) Canceled after 36s
actions/upload-artifact@v4+ refuses to run on Gitea (it's detected as
GHES, and v4's new backend API explicitly isn't supported there -
GHESNotSupportedError). Rather than pin back to the last GHES-compatible
v3.2.2, just remove the step: the publish job doesn't consume this
artifact - it does its own independent checkout+build - so it was only
ever a convenience for manually downloading dist/ from a CI run, not
something the pipeline depends on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 18:34:09 +02:00
valknarandClaude Sonnet 5 4f4c2b6b91 Fix CI: Gitea Actions cache keys never actually changed
CI / Publish to npm registry (push) Canceled after 0s
CI / Build wasm engine (push) Canceled after 5m11s
Confirmed via Gitea's own documentation (about.gitea.com's actions-cache
tutorial): Gitea Actions doesn't support the built-in hashFiles()
expression function GitHub Actions provides - it silently evaluates to
an empty string rather than erroring, so all three cache keys
(emsdk-${{hashFiles(...)}}, etc.) were actually just the constant
strings "emsdk-", "deps-wasm32-", "libwinevbs-wasm32-" on every run,
regardless of whether scripts/versions.sh or patches/ actually changed -
this is why caching "didn't work properly": correctness-wise it's worse
than no caching, since a stale cache from before a version/patch bump
would keep being reused indefinitely instead of invalidating.

Replaced with a plain sha256sum-based step that hashes the same inputs
by hand and exposes them via GITHUB_OUTPUT - no dependency on Gitea
gaining hashFiles() support, and verified locally to produce distinct,
non-empty hashes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 18:27:07 +02:00
valknarandClaude Sonnet 5 d7b95dbac8 Fix CI: install cmake/curl/python3, not just bison
CI / Build wasm engine (push) Failing after 8m31s
CI / Publish to npm registry (push) Skipped
The CI runner's base image doesn't ship cmake (build failed with
"cmake executable not found on PATH" during emcmake), and only bison
was ever explicitly installed - curl and python3 happened to work by
luck of the current runner image, not because the workflow guarantees
them. Install the full README-documented toolchain explicitly in both
the build and publish jobs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 18:22:00 +02:00
5 changed files with 35 additions and 65 deletions
+29 -59
View File
@@ -11,28 +11,41 @@ jobs:
steps:
- uses: https://github.com/actions/checkout@v4
- name: Install bison
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y bison
sudo apt-get install -y bison cmake curl python3
# Gitea Actions doesn't support the built-in hashFiles() expression
# function (unlike GitHub Actions) - it silently evaluates to an empty
# string, which turned every cache key below into the same constant
# string regardless of what actually changed, so a cache entry from
# before a dependency-version or patch change would still be reused
# forever. Hash the same inputs by hand instead.
- name: Compute cache keys
id: cache-keys
run: |
echo "emsdk=$(sha256sum scripts/versions.sh | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
echo "deps-wasm32=$(cat scripts/versions.sh $(find patches -type f | sort) | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
echo "libwinevbs=$(cat scripts/versions.sh $(find patches/libwinevbs -type f | sort) | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
- name: Cache emsdk
uses: https://github.com/actions/cache@v4
with:
path: emsdk
key: emsdk-${{ hashFiles('scripts/versions.sh') }}
key: emsdk-${{ steps.cache-keys.outputs.emsdk }}
- name: Cache wasm32 dependency builds
uses: https://github.com/actions/cache@v4
with:
path: build/deps-wasm32
key: deps-wasm32-${{ hashFiles('scripts/versions.sh', 'patches/**') }}
key: deps-wasm32-${{ steps.cache-keys.outputs.deps-wasm32 }}
- name: Cache libwinevbs build
uses: https://github.com/actions/cache@v4
with:
path: vendor/libwinevbs/build
key: libwinevbs-wasm32-${{ hashFiles('scripts/versions.sh', 'patches/libwinevbs/**') }}
key: libwinevbs-wasm32-${{ steps.cache-keys.outputs.libwinevbs }}
- name: Setup (fetch + patch vendor sources)
run: ./scripts/setup.sh
@@ -59,70 +72,27 @@ jobs:
npm install --no-save typescript
npx tsc -p package/tsconfig.json
- uses: https://github.com/actions/upload-artifact@v4
with:
name: vpinball-wasm-dist
path: dist/
publish:
name: Publish to npm registry
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v4
- name: Install bison
run: |
sudo apt-get update
sudo apt-get install -y bison
- name: Cache emsdk
uses: https://github.com/actions/cache@v4
with:
path: emsdk
key: emsdk-${{ hashFiles('scripts/versions.sh') }}
- name: Cache wasm32 dependency builds
uses: https://github.com/actions/cache@v4
with:
path: build/deps-wasm32
key: deps-wasm32-${{ hashFiles('scripts/versions.sh', 'patches/**') }}
- name: Cache libwinevbs build
uses: https://github.com/actions/cache@v4
with:
path: vendor/libwinevbs/build
key: libwinevbs-wasm32-${{ hashFiles('scripts/versions.sh', 'patches/libwinevbs/**') }}
- name: Setup (fetch + patch vendor sources)
run: ./scripts/setup.sh
- name: Build wasm32 dependencies
run: |
source emsdk/emsdk_env.sh
./scripts/build-deps.sh
- name: Build vpinball
run: |
source emsdk/emsdk_env.sh
./scripts/build.sh
- name: Build npm wrapper
run: |
npm install --no-save typescript
npx tsc -p package/tsconfig.json
# Everything below only runs on a tag push (a release) - reuses the
# exact build just done above instead of the previous separate
# "publish" job, which had `needs: build` but still redundantly
# re-ran the *entire* checkout/cache/setup/build-deps/build/wrapper
# pipeline from scratch, doubling CI time on every release for no
# benefit (Gitea Actions' artifact-passing story is also awkward
# here - upload-artifact@v4+/download-artifact@v4+ aren't supported
# on Gitea at all, see the upload-artifact removal above).
- name: Set package version from the tag
if: startsWith(github.ref, 'refs/tags/')
run: npm pkg set version="${GITHUB_REF_NAME#v}"
# Scoped to this one registry host+path (via publishConfig.registry in
# package.json) rather than actions/setup-node's registry-url, which
# would set it as the *default* registry for every install.
- name: Configure registry auth for publish
if: startsWith(github.ref, 'refs/tags/')
run: npm config set "//dev.pivoine.art/api/packages/valknar/npm/:_authToken" "$PACKAGE_TOKEN"
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
- name: Publish to Gitea npm registry
if: startsWith(github.ref, 'refs/tags/')
run: npm publish
+2 -2
View File
@@ -107,7 +107,7 @@ source emsdk/emsdk_env.sh
## npm usage
```ts
import { loadPinball, attachTouchControls } from '@valknar/vpinball-wasm';
import { loadPinball, attachTouchControls } from 'vpinball-wasm';
const canvas = document.querySelector('canvas');
const pinball = await loadPinball({
@@ -128,7 +128,7 @@ startButton.addEventListener('click', () => {
pinball.evalScript('DMDWidth = 128 : DMDHeight = 32');
```
See `examples/basic/index.html` for a complete working page (loading progress, file upload, touch controls, fullscreen). The published package name/registry (`@valknar/vpinball-wasm` on this project's Gitea npm registry) is a placeholder pending the first real release — see `package.json`.
See `examples/basic/index.html` for a complete working page (loading progress, file upload, touch controls, fullscreen). Published as `vpinball-wasm` on this project's Gitea npm registry — see `package.json`.
## Known limitations
+1 -1
View File
@@ -1,6 +1,6 @@
<!doctype html>
<!--
Full usage example for @valknar/vpinball-wasm: loading progress, a
Full usage example for vpinball-wasm: loading progress, a
user-gesture "Start" button (required for audio autoplay and fullscreen
to work), an optional file picker for a self-contained .vpx table, touch
controls on touch-capable devices, and a fullscreen button.
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@valknar/vpinball-wasm",
"version": "0.0.0",
"name": "vpinball-wasm",
"version": "0.1.0",
"description": "Visual Pinball's engine compiled to WebAssembly - real .vpx tables, real VBScript, WebGL2 rendering, in the browser",
"license": "SEE LICENSE IN LICENSE",
"type": "module",
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Public TypeScript surface for @valknar/vpinball-wasm.
* Public TypeScript surface for vpinball-wasm.
*
* This wraps the raw Emscripten-generated module (dist/vpinball.js) so
* consumers don't need to know about ccall/cwrap/FS internals directly.