-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.16 KB
/
npm-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
45
46
name: Publish package
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Install dependencies and build
run: |
pnpm install
pnpm run build
cp ../../README.md .
cp ../../LICENSE .
working-directory: ./packages/robindoc
- name: Publish on main
if: "!contains(github.ref_name, 'canary')"
run: |
npm set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
npm publish --access public
working-directory: ./packages/robindoc
- name: Publish on canary
if: contains(github.ref_name, 'canary')
run: |
npm set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
npm version --no-git-tag-version ${{github.ref_name}}
npm publish --tag canary --access public
working-directory: ./packages/robindoc