-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (65 loc) · 2.04 KB
/
release.yml
File metadata and controls
68 lines (65 loc) · 2.04 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v0.1.0)"
required: true
type: string
push:
tags:
- "v*.*.*"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ env.RELEASE_TAG }}
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
# Infer from bun.lock
version: ""
working-dir: .
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile --ignore-scripts
- name: Lint and typecheck
run: bun run check
- name: Run tests
run: bun test
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24.16.0
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Verify package version matches tag
run: node -e "const fs=require('node:fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); const tag=process.env.RELEASE_TAG.replace(/^v/,''); if(pkg.version!==tag){console.error(`package.json version ${pkg.version} != tag ${tag}`); process.exit(1)}"
- name: Publish to npm
run: npm publish --provenance --access public
- name: Generate changelog
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: git-cliff.toml
args: -vv --current --strip header
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
body: ${{ steps.git-cliff.outputs.content }}
tag_name: ${{ env.RELEASE_TAG }}