Skip to content

CI/CD

Trigger: Push to main

on:
push:
branches: [main]
StepCommandPurpose
Checkoutactions/checkout@v4Clone the repo
pnpm setuppnpm/action-setup@v4Install pnpm v9
Node setupactions/setup-node@v4Node 20, npm registry, pnpm cache
Installpnpm install --frozen-lockfileInstall deps (lockfile must be up to date)
Buildpnpm turbo run build --filter=@westopp/semtestBuild the main package only
Testpnpm turbo run test --filter=@westopp/semtestRun vitest
Publishpnpm publish --no-git-checksPublish to public npm registry

A second job (update-homebrew) runs after a successful publish:

StepPurpose
Read versionExtract version from package.json
Compute SHA256Download the npm tarball and hash it (retries for propagation)
Checkout tap repoClone westopp/homebrew-semtest using HOMEBREW_TAP_TOKEN
Write formulaOverwrite Formula/semtest.rb with updated URL and hash
PushCommit and push to the tap repo
permissions:
contents: read
SecretPurpose
NPM_TOKENPublish to public npm (NODE_AUTH_TOKEN)
HOMEBREW_TAP_TOKENPush formula updates to westopp/homebrew-semtest

Only @westopp/semtest is built and tested. The docs sites are not part of the publish pipeline.

Trigger: Push to release

on:
push:
branches: [release]

Same build and test steps as stable. The publish step differs:

  1. Reads the current version from package.json
  2. Appends -rc.{run_number} (e.g. 0.1.0-rc.5)
  3. Publishes to GitHub Packages with the rc dist-tag
Terminal window
VERSION=$(node -p "require('./package.json').version")
npm version "${VERSION}-rc.${GITHUB_RUN_NUMBER}" --no-git-tag-version
pnpm publish --no-git-checks --tag rc

This means:

  • RC versions auto-increment via the GitHub Actions run number
  • Installing @westopp/semtest@rc gets the latest RC
  • The version bump is not committed — it only affects the published artifact
  • RC builds require GitHub Packages auth to install (internal testing only)
permissions:
contents: read
packages: write

Uses GITHUB_TOKEN (automatically provided by GitHub Actions) as NODE_AUTH_TOKEN. No manual secret setup needed.