Skip to content

Release CLI

Release CLI #37

Workflow file for this run

name: Release CLI
on:
create:
tags:
- "*"
jobs:
create-github-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') == false
permissions:
contents: "write"
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
publish-to-npm:
name: Build & Publish to NPM
runs-on: ubuntu-latest
needs: [create-github-release]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.com"
- run: npm ci
- run: npm run build
- run: node ./scripts/set-package-version.js packages/cli/package.json
- name: Publish to the public NPM registry
run: npm publish
working-directory: packages/cli
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLIC_NPM_REGISTRY_TOKEN }}
install-and-run-published-artifact:
runs-on: ubuntu-latest
needs: [publish-to-npm]
permissions:
contents: read
steps:
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.com"
# Sanity check to ensure that the package is published and runnable
- run: npx rmoa --help