-
Notifications
You must be signed in to change notification settings - Fork 15
44 lines (37 loc) · 1.16 KB
/
publish.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
name: Publish
on:
release:
types: [published]
jobs:
npm:
name: NPM
runs-on: ubuntu-latest
environment: NPM Release Publishing
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- run: corepack enable pnpm
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: ".nvmrc"
cache: pnpm
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
id: version
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
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Version
run: |
node ./scripts/version.js --version ${{ steps.version.outputs.result }}
- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm run publish
env:
NPM_AUTH_TOKEN: ${{ secrets.ORDZAAR_NPM_BOT }}