Skip to content

Commit e9a7408

Browse files
committed
ci: add npm release steps to actions
1 parent 0d3fa68 commit e9a7408

File tree

2 files changed

+787
-16
lines changed

2 files changed

+787
-16
lines changed

.github/workflows/main.yml

+33-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os: [ubuntu-latest, windows-latest, macOS-latest]
1212

1313
steps:
14-
- name: Checkout repo
14+
- name: Checkout repository
1515
uses: actions/checkout@v2
1616

1717
- name: Use Node ${{ matrix.node }}
@@ -30,3 +30,35 @@ jobs:
3030

3131
- name: Build
3232
run: yarn build
33+
34+
publish:
35+
name: Generate changelog and publish to NPM
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
- name: Configure node
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: 14
45+
46+
- name: Install deps and build (with cache)
47+
uses: bahmutov/npm-install@v1
48+
49+
- name: Generate changelog & tag commit
50+
run: yarn release
51+
52+
- id: publish
53+
uses: JS-DevTools/npm-publish@v1
54+
with:
55+
token: ${{ secrets.NPM_TOKEN }}
56+
access: public
57+
58+
- uses: actions/checkout@v2
59+
run: |
60+
git config user.name github-actions
61+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
62+
git add .
63+
git commit -m "chore(release): publish v${{ steps.publish.outputs.version }}"
64+
git push --follow-tags

0 commit comments

Comments
 (0)