-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (43 loc) · 1.66 KB
/
release.yml
File metadata and controls
54 lines (43 loc) · 1.66 KB
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
49
50
51
52
53
54
name: Publish Package
on:
push:
tags:
- "v*"
permissions:
id-token: write # Required for OIDC
contents: write # Required for publishing GitHub Release
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Uses NPM Trusted Publishers for access to the registry
# See https://docs.npmjs.com/trusted-publishers
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: https://registry.npmjs.org
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@11.6.1
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Publish
run: npm publish --provenance --access public --dry-run=${{ inputs.dryRun && 'true' || 'false' }}
- name: GitHub Release
if: ${{ ! inputs.dryRun }}
uses: ncipollo/release-action@v1.20.0
with:
generateReleaseNotes: true
makeLatest: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish (internal)
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
npm config set "//npm.pkg.github.com/:_authToken=${NPM_PUBLISH_TOKEN}"
npm publish --provenance --access public --dry-run=${{ inputs.dryRun && 'true' || 'false' }} --registry=https://npm.pkg.github.com/