-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.14 KB
/
release.yml
File metadata and controls
78 lines (64 loc) · 2.14 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
69
70
71
72
73
74
75
76
77
78
name: Release (Changesets)
on:
workflow_dispatch:
push:
branches:
- main
env:
CI: true
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
actions: write
steps:
- name: Checkout code repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Typecheck
run: pnpm typecheck
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Build
run: pnpm build
- name: Format
run: pnpm format
- name: Version Update
id: changesets
uses: changesets/action@v1
with:
commit: 'New version release'
title: 'New version release'
publish: pnpm ci:publish
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.SMOOAI_NPM_TOKEN }}
- name: Auto-Merge Changeset PR
run: |
PR_NUMBER=$(gh pr list --state open --head changeset-release/main --json number --jq '.[0].number')
if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then
echo "Found Changeset PR #$PR_NUMBER, attempting to auto-merge..."
gh pr merge "$PR_NUMBER" --auto --squash
else
echo "No open Changeset PR found, skipping merge."
fi
env:
GH_TOKEN: ${{ secrets.GH_PAT }}