-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (54 loc) · 1.38 KB
/
public-package-npmjs.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
name: Publish Package to npmjs
on:
push:
branches: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn
- run: yarn lint
- run: yarn test
- run: yarn build
- run: yarn postbuild
bump_version:
needs: build
runs-on: ubuntu-latest
outputs:
tag_version: ${{ steps.bump.outputs.newTag }}
steps:
- id: checkout
uses: actions/checkout@v3
- id: bump
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
minor-wording: 'add,Adds,new'
major-wording: 'MAJOR,cut-major'
patch-wording: 'patch,fixes'
tag-prefix: 'v'
publish:
needs: bump_version
runs-on: ubuntu-latest
env:
newTag: ${{ needs.bump_version.outputs.tag_version }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.newTag }}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: yarn postbuild
- run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}