CI arc (three commits, one story)
three commits that are really one story: getting CI from “permanently red” to green.
the setup
“wrote” (aka copied and modified) six GitHub Actions workflows in one go:
ci.yml: lint + test + build on push/PR. matrix tests Node 20 and 22. builds the library first, then typechecks the demo. (docs build is commented out because docs don’t exist yet. they will. eventually.)
test.yml: dedicated test runner. same Node 20/22 matrix. runs jest in the Build workspace.
release-npm.yml: publishes to npm on GitHub release. strips private/scripts/devDependencies from package.json, copies README and LICENSE into Build/, publishes with --provenance. has a workflow_dispatch with a dry-run option so I can test without actually publishing.
security-audit.yml: runs npm audit --audit-level=high on all three workspaces (root, Build, Demo). daily cron plus on push when package files change.
static.yml: reworked the GitHub Pages deployment. it was pointed at Build/dist (wrong, that’s the library output). now it builds the library, builds the demo, and deploys Demo/dist as the pages root. docs will go in pages-root/docs/ when they exist.
single-file.yml: was still referencing Web-Template (the old template name). fixed to point at Demo, output file is now UTAUjsEditor.html.
also integrated Updato (my own auto-updater library) into the demo. on load it checks the current build hash against the latest commit on main and shows an update notification if there’s a newer version. the build hash gets injected at build time via __BUILD_HASH__ in the vite config.
cleaned up the TODO: removed all the completed checkboxes (they were cluttering the file), added detail to the remaining items.
the fixes
CI was 0/3 passing. then 1/8 passing. then 2/8. then eventually 8/8. the classic experience.
the single-file and updato workflows needed the library built before the demo (workspace dependency). added npm ci at root level and a “Build Library” step before the demo build. also added vite-plugin-singlefile and cross-env for the build:single script.
second fix commit added ts-node and unrun as dev deps because the ESM config loading was unhappy without them.
three commits to go from red to green. could be worse honestly but whatever
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.