-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.21 KB
/
publish-to-npm-on-new-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
name: Publish to npm and GitHub
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- name: Update version
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
git fetch
git checkout main
npm version patch
- name: Build and Test
run: npm i && npm run build && npm run test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Publish to npm
run: npm run publish-package
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com/
- name: Publish to GitHub Public Repository
run: npm run publish-gpr
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: push version bump back to repo
run: git push origin main