-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.5 KB
/
Copy pathchangeset-release.yml
File metadata and controls
51 lines (42 loc) · 1.5 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
name: Changeset Release Workflow
on:
# Phase 1: Manual trigger to prepare the Release PR
workflow_dispatch:
# Phase 2: Automatic trigger when the PR is merged into main
push:
branches:
- main
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
name: Release Management
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
# Critical: Fetch full history for accurate changelog generation
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Dependencies
run: bun install --ignore-scripts
- name: Create PR or Publish
id: changesets
uses: changesets/action@v1
with:
# Logic: If .changeset files exist, run 'version' and open/update PR
version: bun run version
# Logic: If NO .changeset files exist (post-merge), run 'release'
publish: bun run release
# Automatically create the GitHub Release UI page
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}