-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 852 Bytes
/
publish.yml
File metadata and controls
33 lines (31 loc) · 852 Bytes
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
name: Publish to npm
on:
push:
tags:
- "v*"
jobs:
publish:
name: publish
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.0.0
- name: Setup node
uses: actions/setup-node@v2
with:
# https://github.com/actions/setup-node/issues/32#issuecomment-1003854758
node-version-file: '.nvmrc'
- name: prepare dependencies
run: |
npm install
npm install -g pnpm@7.1.5
- name: test
run: pnpm run precommit
- name: publish
run: |
echo '//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' >> .npmrc
echo 'registry=https://registry.npmjs.org/' >> .npmrc
echo 'always-auth=true' >> .npmrc
npm publish
env:
CI: true
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}