-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.26 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
55
56
name: Publish on Release
on:
release:
types:
- published
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- name: Get Release Tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Cache Node.js modules
uses: actions/cache@v3
id: cache-npm
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Pnpm install
run: pnpm recursive install --frozen-lockfile --strict-peer-dependencies
- name: Build
run: pnpm build
- name: Set git user
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Set version ${{ env.tag }}
run: |
pnpm version ${{ env.tag }}
git push
- name: Publish
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}