Skip to content

Commit 8bd6bf0

Browse files
authored
Create release.yml
Publish to NPM
1 parent 502bc95 commit 8bd6bf0

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: release
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16.14.0
19+
- run: npm install
20+
- run: npm test
21+
- run: npm run build
22+
23+
publish-npm:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: 16.14.0
31+
registry-url: https://registry.npmjs.org/
32+
- run: npm install
33+
- uses: 'marvinpinto/action-automatic-releases@latest'
34+
with:
35+
repo_token: '${{ secrets.GITHUB_TOKEN }}'
36+
prerelease: false
37+
files: LICENSE
38+
- run: npm publish --access public --no-git-checks
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)