-
-
Notifications
You must be signed in to change notification settings - Fork 664
66 lines (58 loc) 路 2.23 KB
/
Copy pathrelease-prepare.yaml
File metadata and controls
66 lines (58 loc) 路 2.23 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
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., 1.2.3)'
required: true
permissions:
contents: write
pull-requests: write
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
# 馃敡 New step to remove stableVersion recursively
- name: Remove all stableVersion fields
run: |
echo "Removing all stableVersion fields from package.json files..."
find . -type f -name package.json -print0 | while IFS= read -r -d '' file; do
if jq 'has("stableVersion")' "$file" | grep -q true; then
echo "Cleaning $file"
tmpfile=$(mktemp)
jq 'del(.stableVersion)' "$file" > "$tmpfile" && mv "$tmpfile" "$file"
fi
done
echo "All stableVersion fields removed."
- name: Update versions, generated output and snapshots
run: |
echo "Updating all workspace versions to ${{ github.event.inputs.version }}"
for pkg in $(find . -name package.json -not -path '*/node_modules/*' -not -path '*/dist/*'); do
jq --arg v "${{ github.event.inputs.version }}" '.version = $v' "$pkg" > tmp.$$.json && mv tmp.$$.json "$pkg"
done
bun install
bun run test:snapshots:update
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore(release): bump version to v${{ github.event.inputs.version }}'
branch: release/v${{ github.event.inputs.version }}
base: master
title: 'Release v${{ github.event.inputs.version }}'
body: |
This PR prepares the release of version v${{ github.event.inputs.version }}.
Once merged into master, the publish workflow will trigger.