Skip to content

Commit 50ca928

Browse files
aadivarclaude
andcommitted
Fix release version alignment with upstream and mark-release-tag push
- build-release.yml now accepts release_version input and bumps package.json before building, so fork releases match upstream tag versions (e.g. v0.0.84) instead of the stale version on main - sync-fork.yml passes upstream release tag to build workflow - mark-release-tag pulls latest before pushing to avoid non-fast-forward rejection (sync-and-build pushes first) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23caedf commit 50ca928

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ name: Build and Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: "Version to release (e.g. 0.0.84). Leave empty to use package.json version."
8+
type: string
9+
default: ""
510
workflow_call:
11+
inputs:
12+
release_version:
13+
description: "Version to release (from upstream tag)"
14+
type: string
15+
default: ""
616

717
# Prevent concurrent builds
818
concurrency:
@@ -18,6 +28,15 @@ jobs:
1828
- name: Checkout
1929
uses: actions/checkout@v4
2030

31+
- name: Bump version to match upstream release
32+
if: inputs.release_version != ''
33+
run: |
34+
# Strip leading 'v' if present (e.g. v0.0.84 -> 0.0.84)
35+
VERSION="${{ inputs.release_version }}"
36+
VERSION="${VERSION#v}"
37+
npm version "$VERSION" --no-git-tag-version
38+
echo "Version bumped to $VERSION"
39+
2140
- name: Setup Python (for node-gyp)
2241
uses: actions/setup-python@v5
2342
with:
@@ -86,6 +105,15 @@ jobs:
86105
- name: Checkout
87106
uses: actions/checkout@v4
88107

108+
- name: Bump version to match upstream release
109+
if: inputs.release_version != ''
110+
run: |
111+
# Strip leading 'v' if present (e.g. v0.0.84 -> 0.0.84)
112+
VERSION="${{ inputs.release_version }}"
113+
VERSION="${VERSION#v}"
114+
npm version "$VERSION" --no-git-tag-version
115+
echo "Version bumped to $VERSION"
116+
89117
- name: Setup Python (for node-gyp)
90118
uses: actions/setup-python@v5
91119
with:
@@ -134,6 +162,15 @@ jobs:
134162
- name: Checkout
135163
uses: actions/checkout@v4
136164

165+
- name: Bump version to match upstream release
166+
if: inputs.release_version != ''
167+
run: |
168+
# Strip leading 'v' if present (e.g. v0.0.84 -> 0.0.84)
169+
VERSION="${{ inputs.release_version }}"
170+
VERSION="${VERSION#v}"
171+
npm version "$VERSION" --no-git-tag-version
172+
echo "Version bumped to $VERSION"
173+
137174
- name: Setup Python (for node-gyp)
138175
uses: actions/setup-python@v5
139176
with:

.github/workflows/sync-fork.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ jobs:
161161
needs: [check-upstream, sync-and-build]
162162
if: needs.check-upstream.outputs.should_release == 'true' && (needs['sync-and-build'].result == 'skipped' || needs['sync-and-build'].outputs.sync_success == 'true')
163163
uses: ./.github/workflows/build-release.yml
164+
with:
165+
release_version: ${{ needs.check-upstream.outputs.latest_release_tag }}
164166
secrets: inherit
165167

166168
mark-release-tag:
@@ -172,13 +174,17 @@ jobs:
172174
- name: Checkout fork
173175
uses: actions/checkout@v4
174176
with:
177+
ref: main
175178
token: ${{ secrets.GITHUB_TOKEN }}
176179

177180
- name: Configure Git
178181
run: |
179182
git config user.name "github-actions[bot]"
180183
git config user.email "github-actions[bot]@users.noreply.github.com"
181184
185+
- name: Pull latest (sync-and-build may have pushed)
186+
run: git pull --rebase origin main
187+
182188
- name: Update last released upstream tag marker
183189
run: |
184190
echo "${{ needs.check-upstream.outputs.latest_release_tag }}" > .last-released-upstream-tag

0 commit comments

Comments
 (0)