Skip to content

Commit dfc7587

Browse files
committed
Added publish action
1 parent 794ecc2 commit dfc7587

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish npm package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '16'
22+
registry-url: https://registry.npmjs.org/
23+
scope: '@wonderium'
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Apply settings
29+
run: |
30+
git config user.name github-actions
31+
git config user.email [email protected]
32+
npm version ${{ github.event.inputs.version }}
33+
git push origin main
34+
git push origin v${{ github.event.inputs.version }}
35+
36+
- name: Create build
37+
run: npm run build
38+
39+
- name: Publish package
40+
run: npm publish --access public
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)