Skip to content

Commit 5484b91

Browse files
committed
adds release workflow
1 parent 6e16692 commit 5484b91

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
cache: 'npm'
2424

2525
- name: Install dependencies
26-
run: npm install
26+
run: npm ci
2727

2828
- name: Lint
2929
run: npm run lint

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v4
11+
with:
12+
ref: ${{ github.event.release.target_commitish }}
13+
14+
- name: Validate and extract release information
15+
id: release
16+
uses: manovotny/github-releases-for-automated-package-publishing-action@v2.0.1
17+
18+
- name: Setup NodeJS
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: 'npm'
23+
always-auth: true
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Publish version
33+
if: steps.release.outputs.tag == ''
34+
run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: Publish tagged version
39+
if: steps.release.outputs.tag != ''
40+
run: npm publish --tag ${{ steps.release.outputs.tag }}
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)