Skip to content

Commit 24b2dad

Browse files
committed
add publish workflow
edit publish workflow edit tests workflow triggers
1 parent 07efd95 commit 24b2dad

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/publish.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
8+
jobs:
9+
tests-workflow:
10+
uses: ./.github/workflows/tests.yml
11+
publish:
12+
needs: [tests-workflow]
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: '21.x'
22+
registry-url: 'https://registry.npmjs.org'
23+
- uses: pnpm/action-setup@v2
24+
name: Install pnpm
25+
with:
26+
version: 8
27+
run_install: true
28+
- name: Build
29+
run: pnpm build
30+
- name: Pack
31+
run: rm -f *.tgz && npm pack
32+
- name: Publish
33+
run: npm publish *.tgz --provenance
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
tags-ignore:
11+
- '*'
12+
workflow_call:
413

514
jobs:
615
cypress-run:
@@ -9,7 +18,7 @@ jobs:
918
- uses: actions/checkout@v3
1019
- uses: actions/setup-node@v3
1120
with:
12-
node-version: '16.x'
21+
node-version: '21.x'
1322
- name: Install dependencies
1423
run: yarn
1524
- name: Install Linux Webkit deps

0 commit comments

Comments
 (0)