-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (46 loc) · 1.4 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Publish
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
do_release:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Build library
run: |
npm install
npm run build
- name: Publish to npmjs
if: startsWith(github.ref, 'refs/tags')
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Pack library
run: |
npm pack
echo "NPM_TGZ=$(ls jsfive*.tgz)" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.NPM_TGZ }}
- name: Update current release
if: startsWith(github.ref, 'refs/tags')
uses: johnwbyrd/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.NPM_TGZ }}