Skip to content

Commit 84316de

Browse files
authored
Fix release preflight gaps from PR #140 review (#141)
* Add Ruby, Kotlin, and Swift version preflight checks to make release The release target only verified Go and TypeScript version constants before tagging, so a stale Ruby/Kotlin/Swift version would push a tag and let the workflows fail after the fact. Check all five SDKs upfront. * Reinstate Kotlin generated-code drift guard in release workflow When the Kotlin release was extracted from test.yml into its own workflow, the :generator:run + git diff check was dropped. Without it a v* tag could publish a Kotlin artifact with stale generated sources.
1 parent 4b2bec6 commit 84316de

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/release-kotlin.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ jobs:
7979
- name: Test
8080
run: ./gradlew :basecamp-sdk:check
8181

82+
- name: Check generated code drift
83+
run: |
84+
./gradlew :generator:run --args="--openapi ../openapi.json --behavior ../behavior-model.json --output sdk/src/commonMain/kotlin/com/basecamp/sdk/generated"
85+
if ! git diff --quiet -- sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/; then
86+
echo "::error::Generated Kotlin code is out of date. Run 'make kt-generate-services' and commit."
87+
git diff --stat -- sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/
88+
exit 1
89+
fi
90+
echo "Generated code is up to date"
91+
8292
publish:
8393
name: Publish to GitHub Packages
8494
needs: [smithy, test]

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ endif
143143
{ echo "ERROR: Go version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
144144
@grep -q '"version": "$(VERSION)"' typescript/package.json || \
145145
{ echo "ERROR: TypeScript version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
146+
@grep -q 'VERSION = "$(VERSION)"' ruby/lib/basecamp/version.rb || \
147+
{ echo "ERROR: Ruby version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
148+
@grep -q 'const val VERSION = "$(VERSION)"' kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/BasecampConfig.kt || \
149+
{ echo "ERROR: Kotlin version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
150+
@grep -q 'public static let version = "$(VERSION)"' swift/Sources/Basecamp/BasecampConfig.swift || \
151+
{ echo "ERROR: Swift version does not match $(VERSION). Run 'make bump VERSION=$(VERSION)' first."; exit 1; }
146152
@git diff --quiet && git diff --cached --quiet || \
147153
{ echo "ERROR: Working tree has uncommitted changes. Commit first."; exit 1; }
148154
git tag "v$(VERSION)"

0 commit comments

Comments
 (0)