Skip to content

Commit 33874e1

Browse files
committed
chore: Update release process again
1 parent cb2f835 commit 33874e1

2 files changed

Lines changed: 76 additions & 1 deletion

File tree

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config/schema.json",
33
"changelog": [
4-
"./.changeset/changelog.cjs",
4+
"./changelog.cjs",
55
{
66
"repo": "braintrustdata/braintrust-sdk-javascript",
77
"ignoredAuthors": ["abhiprasad", "lforst", "qard"]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Prepare Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
concurrency:
11+
group: prepare-js-release-${{ github.ref_name }}
12+
cancel-in-progress: false
13+
14+
env:
15+
HUSKY: "0"
16+
17+
jobs:
18+
prepare-release:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 20
21+
steps:
22+
# TODO: Uncomment before merging this
23+
# - name: Require main branch
24+
# run: |
25+
# if [ "${{ github.ref_name }}" != "main" ]; then
26+
# {
27+
# echo "## Prepare JS release"
28+
# echo
29+
# echo "This workflow must be run from \`main\`. Selected ref: \`${{ github.ref_name }}\`."
30+
# } >> "$GITHUB_STEP_SUMMARY"
31+
# exit 1
32+
# fi
33+
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
34+
# with:
35+
# fetch-depth: 0
36+
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
37+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
38+
with:
39+
node-version-file: .tool-versions
40+
cache: pnpm
41+
- name: Install dependencies
42+
run: pnpm install --frozen-lockfile
43+
- name: Validate publishable package metadata
44+
run: node scripts/release/validate-publishable-packages.mjs
45+
- name: Record source commit and release branch
46+
id: source
47+
run: |
48+
main_sha="$(git rev-parse HEAD)"
49+
short_main_sha="$(git rev-parse --short=12 HEAD)"
50+
release_branch="release/${short_main_sha}"
51+
52+
{
53+
echo "main_sha=$main_sha"
54+
echo "short_main_sha=$short_main_sha"
55+
echo "release_branch=$release_branch"
56+
} >> "$GITHUB_OUTPUT"
57+
- name: Run changeset version
58+
run: pnpm exec changeset version
59+
- name: Create release commit
60+
run: |
61+
git config user.name "github-actions[bot]"
62+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
63+
git switch -c "${{ steps.source.outputs.release_branch }}"
64+
git add -A
65+
git commit -m "chore: Prepare changelog"
66+
git push origin HEAD:refs/heads/${{ steps.source.outputs.release_branch }}
67+
- name: Create or update release PR
68+
env:
69+
GITHUB_TOKEN: ${{ github.token }}
70+
run: >
71+
node scripts/release/upsert-pull-request.mjs
72+
--base release
73+
--head "${{ steps.source.outputs.release_branch }}"
74+
--title "chore: Prepare for release (${{ steps.source.outputs.short_main_sha }})"
75+
--body "Prepares a release by updating changelogs and package versions, and synchronizing everything to the release branch."

0 commit comments

Comments
 (0)