CI and GitHub Action
Generate and publish bindings from CI.
CLI
The CLI is designed to work in CI without any GitMyABI account: only an npm registry token is needed when publishing. The official GitHub Action wraps gma generate and gma publish with sensible defaults; the underlying CLI works on any runner.
GitHub Action
The action lives at the path:
uses: ./actions/gma # repo-relative
# or
uses: OWNER/gitmyabi-cli/actions/gma@v0.1.0Inputs
working-directory— project directory containinggma.config.json(default.).node-version— Node version installed by the action (default20).gitmyabi-version— version of thegitmyabipackage to install (defaultlatest).extra-generate-args— extra arguments forwarded togma generate.output-dir— output directory used to locate the produced.tgz(defaultgma-out).publish—trueto publish the tarball after generating (defaultfalse).registry— npm registry URL (defaulthttps://registry.npmjs.org).access— npm access (defaultpublic).tag— npm dist-tag.dry-run— set totruefor a publish dry run (defaultfalse).npm-token— registry auth token, only required whenpublish: trueanddry-runis false.
Outputs
tarball— absolute path to the generated.tgz.
Foundry example
name: bindings
on: { push: { branches: [main] } }
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
- run: forge build
- uses: ./actions/gma
with:
working-directory: .Hardhat example
name: bindings
on: { push: { branches: [main] } }
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm ci
- run: npx hardhat compile
- uses: ./actions/gma
with:
working-directory: .Publish example
- uses: ./actions/gma
with:
publish: 'true'
registry: https://registry.npmjs.org
access: public
npm-token: ${{ secrets.NPM_TOKEN }}Dry-run example
- uses: ./actions/gma
with:
publish: 'true'
dry-run: 'true'CLI directly in CI
On any runner you can install the CLI and call the same commands. No gma login is needed for generate or publish.
npm i -g gitmyabi
gma generate
gma publish \
--registry https://registry.npmjs.org \
--token "$NPM_TOKEN"Related
- CLI overview
What the gma CLI does and when to use it.
- Generate bindings with the CLI
Use gma generate to produce a typed bindings tarball.
- Publish bindings with the CLI
Use gma publish to upload a bindings tarball to npm.
- Environment variables
Environment variables the gma CLI reads.
- Command reference
Concise reference of every gma command and key flags.