-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (45 loc) · 1.37 KB
/
release.yml
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
name: Release
on:
release:
types: [published]
permissions:
contents: read
packages: write
jobs:
Version:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.version.outputs.result }}
steps:
- id: version
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const semver = context.ref.replace('refs/tags/v', '')
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
return semver
}
throw new Error('not semver')
result-encoding: string
NPM:
runs-on: ubuntu-latest
needs: Version
environment: NPM Release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-node@bea5baf987ba7aa777a8a0b4ace377a21c45c381 # v3.8.0
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: lerna version ${{ needs.Version.outputs.result }} --yes --no-push --no-git-tag-version --exact
- run: npm run build
- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish --workspaces --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true