Skip to content

Commit 70f3043

Browse files
committed
Unify release triggers on global v* tag
Replace per-SDK tag namespaces (go/v*, ts/v*, etc.) with a single v* tag trigger across all 5 release workflows. One tag push fires all SDK releases in parallel. - Simplify version extraction (no case statements) - Simplify changelog PREV_TAG matching - Add `make release VERSION=x.y.z` target with pre-flight checks - Rename release.yml → release-go.yml for consistency Release flow: make bump VERSION=x.y.z → commit → make release VERSION=x.y.z
1 parent 761b039 commit 70f3043

File tree

5 files changed

+36
-17
lines changed

5 files changed

+36
-17
lines changed

.github/workflows/release-go.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'go/v*'
6+
- 'v*'
77
workflow_dispatch: # Manual trigger is always dry-run (rehearsal mode)
88

99
permissions:
@@ -105,8 +105,8 @@ jobs:
105105
echo "version=$VERSION" >> $GITHUB_OUTPUT
106106
echo "Rehearsal for version: $VERSION"
107107
else
108-
# Tag trigger: extract from tag
109-
VERSION="${GITHUB_REF#refs/tags/go/}"
108+
# Tag trigger: extract from tag (v0.2.1 → v0.2.1, Go keeps v prefix)
109+
VERSION="${GITHUB_REF#refs/tags/}"
110110
echo "version=$VERSION" >> $GITHUB_OUTPUT
111111
echo "Releasing version: $VERSION"
112112
fi
@@ -136,7 +136,7 @@ jobs:
136136
- name: Build changelog prompt
137137
id: changelog-inputs
138138
run: |
139-
PREV_TAG=$(git describe --tags --match 'go/v*' --abbrev=0 HEAD^ 2>/dev/null || true)
139+
PREV_TAG=$(git describe --tags --match 'v*' --abbrev=0 HEAD^ 2>/dev/null || true)
140140
if [ -z "$PREV_TAG" ]; then
141141
COMMITS=$(git log --pretty=format:"- %s (%h)" -- go/)
142142
git diff --stat HEAD -- go/ > /tmp/sdk-diff.txt

.github/workflows/release-ruby.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Ruby SDK
33
on:
44
push:
55
tags:
6-
- 'ruby/v*'
6+
- 'v*'
77
workflow_dispatch: # Manual trigger is always dry-run (rehearsal mode)
88

99
permissions:
@@ -112,8 +112,8 @@ jobs:
112112
echo "version=$VERSION" >> $GITHUB_OUTPUT
113113
echo "Rehearsal for version: $VERSION"
114114
else
115-
# Tag trigger: extract from tag and verify match
116-
VERSION="${GITHUB_REF#refs/tags/ruby/v}"
115+
# Tag trigger: extract from tag (v0.2.1 → 0.2.1)
116+
VERSION="${GITHUB_REF#refs/tags/v}"
117117
GEM_VERSION=$(ruby -e "require_relative 'lib/basecamp/version'; puts Basecamp::VERSION")
118118
if [ "$GEM_VERSION" != "$VERSION" ]; then
119119
echo "::error::Gem version ($GEM_VERSION) does not match tag version ($VERSION)"
@@ -146,7 +146,7 @@ jobs:
146146
id: changelog-inputs
147147
run: |
148148
cd ..
149-
PREV_TAG=$(git describe --tags --match 'ruby/v*' --abbrev=0 HEAD^ 2>/dev/null || true)
149+
PREV_TAG=$(git describe --tags --match 'v*' --abbrev=0 HEAD^ 2>/dev/null || true)
150150
if [ -z "$PREV_TAG" ]; then
151151
COMMITS=$(git log --pretty=format:"- %s (%h)" -- ruby/)
152152
git diff --stat HEAD -- ruby/ > /tmp/sdk-diff.txt

.github/workflows/release-swift.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Swift SDK
33
on:
44
push:
55
tags:
6-
- 'swift/v*'
6+
- 'v*'
77
workflow_dispatch: # Manual trigger is always dry-run (rehearsal mode)
88

99
permissions:
@@ -92,15 +92,16 @@ jobs:
9292
echo "version=$VERSION" >> $GITHUB_OUTPUT
9393
echo "Rehearsal for version: $VERSION"
9494
else
95-
VERSION="${GITHUB_REF#refs/tags/swift/}"
95+
# Tag trigger: extract from tag (v0.2.1, Swift keeps v prefix)
96+
VERSION="${GITHUB_REF#refs/tags/}"
9697
echo "version=$VERSION" >> $GITHUB_OUTPUT
9798
echo "Releasing version: $VERSION"
9899
fi
99100
100101
- name: Build changelog prompt
101102
id: changelog-inputs
102103
run: |
103-
PREV_TAG=$(git describe --tags --match 'swift/v*' --abbrev=0 HEAD^ 2>/dev/null || true)
104+
PREV_TAG=$(git describe --tags --match 'v*' --abbrev=0 HEAD^ 2>/dev/null || true)
104105
if [ -z "$PREV_TAG" ]; then
105106
COMMITS=$(git log --pretty=format:"- %s (%h)" -- swift/ Package.swift)
106107
git diff --stat HEAD -- swift/ Package.swift > /tmp/sdk-diff.txt

.github/workflows/release-typescript.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release TypeScript SDK
33
on:
44
push:
55
tags:
6-
- 'ts/v*'
6+
- 'v*'
77
workflow_dispatch: # Manual trigger is always dry-run (rehearsal mode)
88

99
permissions:
@@ -145,8 +145,8 @@ jobs:
145145
echo "version=$VERSION" >> $GITHUB_OUTPUT
146146
echo "Rehearsal for version: $VERSION"
147147
else
148-
# Tag trigger: extract from tag and verify match
149-
VERSION="${GITHUB_REF#refs/tags/ts/v}"
148+
# Tag trigger: extract from tag (v0.2.1 → 0.2.1)
149+
VERSION="${GITHUB_REF#refs/tags/v}"
150150
PKG_VERSION=$(node -p "require('./package.json').version")
151151
if [ "$PKG_VERSION" != "$VERSION" ]; then
152152
echo "::error::Package version ($PKG_VERSION) does not match tag version ($VERSION)"
@@ -180,7 +180,7 @@ jobs:
180180
id: changelog-inputs
181181
run: |
182182
cd ..
183-
PREV_TAG=$(git describe --tags --match 'ts/v*' --abbrev=0 HEAD^ 2>/dev/null || true)
183+
PREV_TAG=$(git describe --tags --match 'v*' --abbrev=0 HEAD^ 2>/dev/null || true)
184184
if [ -z "$PREV_TAG" ]; then
185185
COMMITS=$(git log --pretty=format:"- %s (%h)" -- typescript/)
186186
git diff --stat HEAD -- typescript/ > /tmp/sdk-diff.txt

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Orchestrates both Smithy spec and Go SDK
44

5-
.PHONY: all check clean help provenance-sync provenance-check sync-status bump sync-api-version sync-api-version-check
5+
.PHONY: all check clean help provenance-sync provenance-check sync-status bump sync-api-version sync-api-version-check release
66

77
# Default: run all checks
88
all: check
@@ -132,6 +132,23 @@ ifndef VERSION
132132
endif
133133
@./scripts/bump-version.sh $(VERSION)
134134

135+
# Tag and push a global release: make release VERSION=x.y.z
136+
release:
137+
ifndef VERSION
138+
$(error VERSION is required. Usage: make release VERSION=x.y.z)
139+
endif
140+
@echo "Releasing v$(VERSION)..."
141+
@# Verify version constants match
142+
@grep -q 'Version = "$(VERSION)"' go/pkg/basecamp/version.go || \
143+
{ echo "ERROR: Go version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
144+
@grep -q '"version": "$(VERSION)"' typescript/package.json || \
145+
{ echo "ERROR: TypeScript version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
146+
@git diff --quiet && git diff --cached --quiet || \
147+
{ echo "ERROR: Working tree has uncommitted changes. Commit first."; exit 1; }
148+
git tag "v$(VERSION)"
149+
git push origin "v$(VERSION)"
150+
@echo "Pushed v$(VERSION) — all SDK release workflows will trigger."
151+
135152
# Sync API_VERSION constants from openapi.json info.version
136153
sync-api-version:
137154
@./scripts/sync-api-version.sh
@@ -452,10 +469,11 @@ help:
452469
@echo " provenance-check Verify Go embedded provenance is up to date"
453470
@echo " sync-status Show upstream changes since last spec sync"
454471
@echo ""
455-
@echo "Version:"
472+
@echo "Version & Release:"
456473
@echo " bump VERSION=x.y.z Bump SDK version across all languages"
457474
@echo " sync-api-version Sync API_VERSION from openapi.json"
458475
@echo " sync-api-version-check Verify API_VERSION constants are up to date"
476+
@echo " release VERSION=x.y.z Tag and push a global release (triggers all SDK releases)"
459477
@echo ""
460478
@echo "Combined:"
461479
@echo " check Run all checks (Smithy + Go + TypeScript + Ruby + Swift + Conformance + Provenance)"

0 commit comments

Comments
 (0)