-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 916 Bytes
/
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
name: NPM publish CD workflow
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.16.0'
check-latest: true
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn test
- run: git config --global user.name "ylkhayat" user.email "[email protected]"
- run: yarn version --new-version ${{ github.event.release.tag_name }}
- run: yarn build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}