-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.16 KB
/
main.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
name: build and publish
on:
push:
branches:
- main
paths:
- 'MaskNumber/**'
- .github/**
- 'package.json'
- 'pnpm-lock.yaml'
jobs:
publish:
name: build and publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install pnpm
uses: pnpm/[email protected]
with:
version: 7.14.1
- name: set node version to 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: build
run: |
pnpm install
pnpm build
git config user.name github-actions
git config user.email ${{ secrets.EMAIL }}
pnpm version patch -m "upgraded to %s"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM }}
- run: |
git pull --rebase
git push origin HEAD --follow-tags
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM }}