-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 937 Bytes
/
Copy pathrelease.yml
File metadata and controls
36 lines (33 loc) · 937 Bytes
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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run typecheck
- run: bun run build
- run: bun test test/unit
- name: Verify package version matches tag
run: |
PKG_VERSION=$(bun -e "console.log(require('./package.json').version)")
TAG_VERSION=${GITHUB_REF_NAME#v}
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "package.json version ($PKG_VERSION) does not match tag ($TAG_VERSION)"
exit 1
fi
- name: Publish
run: bun publish --access public --provenance
env:
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}