Skip to content

Commit 6adb111

Browse files
authored
chore: create a reusable release workflow file (#446)
1 parent e7e3959 commit 6adb111

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Reusable Release Workflow
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
NODE_AUTH_TOKEN:
7+
required: true
8+
9+
env:
10+
CI: true
11+
jobs:
12+
publish-npm:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Prepare for publication to npm
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version-file: ".nvmrc"
20+
registry-url: "https://registry.npmjs.org"
21+
cache: npm
22+
- run: npm ci
23+
- if: ${{ contains(github.ref_name, 'beta') }}
24+
run: npm publish --access public --tag beta
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
27+
- if: ${{ contains(github.ref_name, 'alpha') }}
28+
run: npm publish --access public --tag alpha
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
31+
- if: ${{ !contains(github.ref_name, 'alpha') && !contains(github.ref_name, 'beta') }}
32+
run: npm publish --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)