-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (48 loc) Β· 1.63 KB
/
publish.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
49
50
51
52
53
54
55
56
57
58
59
60
name: π Release + Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 1.2.3)'
required: false
permissions:
id-token: write
contents: write
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: π₯ Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Required for fetching tags and generating release notes
fetch-depth: 0
- name: π§ Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
with:
bun-version-file: ".bun-version"
- name: π¦ Install dependencies
run: bun install --frozen-lockfile
- name: π§ Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git config --global push.followTags true
- name: π Prepare release
run: bun run preversion
- name: π Generate changelog and release notes
env:
VERSION: ${{ github.event.inputs.version }}
run: |
bunx changelogen --release --push -r $VERSION
bunx changelogen github release --token ${{ secrets.GITHUB_TOKEN }} -r $VERSION
- name: π οΈ Build package
run: bun run build
- name: π¦ Publish to NPM Registry
run: |
bunx npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
bunx npm publish --provenance --access public