Skip to content

Commit 4bf546f

Browse files
committed
feat: release readiness - smithy-kotlin branch check
1 parent f65b997 commit 4bf546f

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed
Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release readiness (snapshot dependency)
2-
3-
# Makes sure that we aren't relying on SNAPSHOT/dev versions of smithy-kotlin before merging
4-
# Otherwise we could forget because the rest of CI is masking it
2+
description: >
3+
Makes sure that we aren't relying on SNAPSHOT/dev versions of smithy-kotlin before merging
4+
otherwise we could forget because the rest of CI is masking it.
55
66
on:
77
pull_request:
@@ -11,22 +11,53 @@ jobs:
1111
release-readiness:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout sources
14+
- name: Checkout source
1515
uses: actions/checkout@v4
16+
with:
17+
path: 'aws-sdk-kotlin'
1618

1719
- name: Configure Gradle
1820
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
21+
with:
22+
working-directory: ./aws-sdk-kotlin
1923

2024
- name: Build SDK
25+
working-directory: ./aws-sdk-kotlin
2126
run: ./gradlew test jvmTest
2227

2328
- name: Build SDK client
29+
working-directory: ./aws-sdk-kotlin
2430
run: |
2531
./gradlew -Paws.kotlin.native=false -Paws.services=s3 bootstrap
2632
./gradlew -Paws.kotlin.native=false build
2733
34+
- name: Checkout smithy-kotlin
35+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/checkout-head@main
36+
with:
37+
path: 'smithy-kotlin'
38+
repository: 'smithy-lang/smithy-kotlin'
39+
40+
# TODO: Change grep pattern when we decouple runtime and codegen releases
41+
- name: Check for smithy-kotlin unreleased changes
42+
run: |
43+
cd aws-sdk-kotlin
44+
SDK_BRANCH=$(git branch --show-current)
45+
46+
cd ../smithy-kotlin
47+
SMITHY_BRANCH=$(git branch --show-current)
48+
49+
if [ "$SDK_BRANCH" = "$SMITHY_BRANCH" ]; then
50+
cd ../aws-sdk-kotlin
51+
git diff origin/main -- gradle/libs.versions.toml | grep -E "smithy-kotlin-runtime-version|smithy-kotlin-codegen-version"
52+
export SMITHY_KOTLIN_VERSION_BUMP=$($?)
53+
54+
if [ "$SMITHY_KOTLIN_VERSION_BUMP" != 0 ]; then
55+
exit 1
56+
fi
57+
fi
58+
2859
- name: Emit error message
2960
if: ${{ failure() }}
3061
run: |
31-
echo "::error ::Build failed. Did you forget to release smithy-kotlin and bump the dependency version?"
62+
echo "::error ::Did you forget to release smithy-kotlin and bump the dependency version?"
3263
exit 1

0 commit comments

Comments
 (0)