11name : 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
66on :
77 pull_request :
@@ -11,22 +11,57 @@ jobs:
1111 release-readiness :
1212 runs-on : ubuntu-latest
1313 steps :
14- - name : Checkout sources
14+ - name : Checkout SDK
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+ - name : Check for smithy-kotlin unreleased changes
41+ run : |
42+ echo "aws-sdk-kotlin branch: $GITHUB_HEAD_REF"
43+
44+ cd smithy-kotlin
45+ SMITHY_KOTLIN_BRANCH=$(git branch --show-current)
46+ echo "smithy-kotlin branch: $SMITHY_KOTLIN_BRANCH"
47+
48+ if [ "$GITHUB_HEAD_REF" == "$SMITHY_KOTLIN_BRANCH" ]; then
49+ cd ../aws-sdk-kotlin
50+ git fetch origin
51+
52+ DIFF=$(git diff origin/main -- gradle/libs.versions.toml | grep '^[-+][^-+]'; exit 0)
53+ SMITHY_KOTLIN_VERSION_BUMP=$(echo "$DIFF" | grep "smithy-kotlin-runtime-version =\|smithy-kotlin-codegen-version ="; exit 0)
54+
55+ if [ -z "$SMITHY_KOTLIN_VERSION_BUMP" ]; then
56+ echo "::error::Matching smithy-kotlin and aws-sdk-kotlin branches but no smithy-kotlin version bump"
57+ exit 1
58+ else
59+ echo "Matching smithy-kotlin and aws-sdk-kotlin branches with smithy-kotlin version bump detected"
60+ fi
61+ fi
62+
2863 - name : Emit error message
2964 if : ${{ failure() }}
3065 run : |
31- echo "::error ::Build failed. Did you forget to release smithy-kotlin and bump the dependency version?"
66+ echo "::error:: Did you forget to release smithy-kotlin and bump the dependency version?"
3267 exit 1
0 commit comments