Release CLI #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: \[Debug\] Check npm config | |
run: npm config list | |
working-directory: packages/cli | |
- 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 |