Skip to content

Commit e104e1a

Browse files
committed
feat: add publish workflows
Adds a publish workflow and updates a few dev scripts/dependencies to reduce the install size and security audit notices.
1 parent e5fddbb commit e104e1a

File tree

3 files changed

+1898
-8699
lines changed

3 files changed

+1898
-8699
lines changed

.github/workflows/npm-publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Publish to npm
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
- run: npm ci
19+
- run: npm test
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
permissions:
25+
id-token: write
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 22.x
31+
registry-url: 'https://registry.npmjs.org'
32+
cache: 'npm'
33+
- run: npm ci
34+
- run: npm version ${TAG_NAME} --git-tag-version=false
35+
env:
36+
TAG_NAME: ${{ github.ref_name }}
37+
- run: npm publish --provenance --access public --tag next
38+
if: "github.event.release.prerelease"
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.npm_secret }}
41+
- run: npm publish --provenance --access public
42+
if: "!github.event.release.prerelease"
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.npm_secret }}

0 commit comments

Comments
 (0)