|
| 1 | +name: Release readiness (snapshot dependency) |
| 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. |
| 5 | +
|
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + types: [ opened, synchronize, reopened, labeled, unlabeled ] |
| 9 | + branches: [ main ] |
| 10 | + |
| 11 | +permissions: { } |
| 12 | + |
| 13 | +jobs: |
| 14 | + release-readiness: |
| 15 | + if: ${{ !contains(github.event.pull_request.labels.*.name, 'ready-for-release') }} |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout SDK |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + path: 'aws-sdk-kotlin' |
| 22 | + |
| 23 | + - name: Configure Gradle |
| 24 | + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main |
| 25 | + with: |
| 26 | + working-directory: ./aws-sdk-kotlin |
| 27 | + |
| 28 | + - name: Build SDK |
| 29 | + working-directory: ./aws-sdk-kotlin |
| 30 | + run: ./gradlew test jvmTest |
| 31 | + |
| 32 | + - name: Build SDK client |
| 33 | + working-directory: ./aws-sdk-kotlin |
| 34 | + run: | |
| 35 | + ./gradlew -Paws.kotlin.native=false -Paws.services=s3 bootstrap |
| 36 | + ./gradlew -Paws.kotlin.native=false build |
| 37 | +
|
| 38 | + - name: Checkout smithy-kotlin |
| 39 | + uses: awslabs/aws-kotlin-repo-tools/.github/actions/checkout-head@main |
| 40 | + with: |
| 41 | + path: 'smithy-kotlin' |
| 42 | + repository: 'smithy-lang/smithy-kotlin' |
| 43 | + |
| 44 | + - name: Check for smithy-kotlin unreleased changes |
| 45 | + run: | |
| 46 | + echo "aws-sdk-kotlin branch: $GITHUB_HEAD_REF" |
| 47 | + |
| 48 | + cd smithy-kotlin |
| 49 | + SMITHY_KOTLIN_BRANCH=$(git branch --show-current) |
| 50 | + echo "smithy-kotlin branch: $SMITHY_KOTLIN_BRANCH" |
| 51 | + |
| 52 | + if [ "$GITHUB_HEAD_REF" == "$SMITHY_KOTLIN_BRANCH" ]; then |
| 53 | + cd ../aws-sdk-kotlin |
| 54 | + git fetch origin |
| 55 | +
|
| 56 | + DIFF=$(git diff origin/main -- gradle/libs.versions.toml | grep '^[-+][^-+]'; exit 0) |
| 57 | + SMITHY_KOTLIN_VERSION_BUMP=$(echo "$DIFF" | grep "smithy-kotlin-runtime-version =\|smithy-kotlin-codegen-version ="; exit 0) |
| 58 | +
|
| 59 | + if [ -z "$SMITHY_KOTLIN_VERSION_BUMP" ]; then |
| 60 | + echo "::error::Matching smithy-kotlin and aws-sdk-kotlin branches but no smithy-kotlin version bump" |
| 61 | + exit 1 |
| 62 | + else |
| 63 | + echo "Matching smithy-kotlin and aws-sdk-kotlin branches with smithy-kotlin version bump detected" |
| 64 | + fi |
| 65 | + fi |
| 66 | +
|
| 67 | + - name: Emit error message |
| 68 | + if: ${{ failure() }} |
| 69 | + run: | |
| 70 | + echo "::error::Did you forget to release smithy-kotlin and bump the dependency version?" |
| 71 | + exit 1 |
0 commit comments