-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (50 loc) · 1.44 KB
/
release-cli.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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