When a new Motoko version is released at caffeinelabs/motoko,
the update-moc workflow is triggered via repository_dispatch.
It automatically:
- Downloads the new
moc.js/moc_interpreter.jsand core library - Updates error code explanations
- Bumps the npm version (minor)
- Runs tests
- Opens a PR titled "Update moc to <version>"
Review and merge the PR when ready.
You can also trigger the workflow manually from the Actions tab (workflow_dispatch),
with optional moc_version and core_version inputs. Leave them empty to auto-detect the latest.
After merging a moc update (or any version bump), bump the version field in package.json and merge to main.
The release workflow runs when package.json changes on main. If the version field changed compared to the previous commit on main, it will:
- Build and test
- Publish to npm via OIDC trusted publishing (no tokens needed)
- Notify vscode-motoko to open a PR bumping the
motokodependency (GitHub App must include thevscode-motokorepo; same app asupdate-moc)
Updating the version in package.json automatically publishes the package when merged into main.
To regenerate files locally against a specific version:
npm ci
npm run build
npm run generate # prints latest versions and suggested command
npm run generate <moc_version> <core_version>Set MOTOKO_REPO to point to a local motoko checkout (used for error codes).
Defaults to ../../motoko/.