-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (42 loc) · 1.25 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
45
46
47
48
49
50
51
52
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
issues: read
steps:
- name: Begin CI...
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version-file: .node-version
registry-url: "https://registry.npmjs.org/"
scope: "@nanlabs"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Copy the .npmrc file to the HOME and project directories
run: cp $NPM_CONFIG_USERCONFIG $HOME/.npmrc && cp -f $NPM_CONFIG_USERCONFIG .
- name: Install dependencies
run: npm ci
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
if: steps.changesets.outputs.hasChangesets == 'false'
run: npm run publish-packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}