Skip to content

Commit d6b7610

Browse files
committed
test codebuild invocation
1 parent 180fa6f commit d6b7610

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/run-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ jobs:
5959
role-to-assume: ${{ secrets.PUBLISHING_ROLE_ARN }}
6060
aws-region: us-west-2
6161

62-
- name: Run release
63-
env:
64-
RELEASE_BUCKET: ${{ secrets.RELEASE_BUCKET }}
65-
run: |
66-
./scripts/release.sh
62+
- name: Run CodeBuild
63+
uses: aws-actions/aws-codebuild-run-build@v1
64+
with:
65+
project-name: publish-aws-kotlin-repo-tools
66+
source-version-override: ${{ steps.resolve-version.outputs.NEW_VERSION }}
6767

6868
- name: Delete failed release tag
6969
if: ${{ failure() }}

scripts/release.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
[ -z "$RELEASE_BUCKET" ] && { echo "RELEASE_BUCKET environment variable not set"; exit 1; }
4+
[ -z "$PUBLISHING_ROLE_ARN" ] && { echo "PUBLISHING_ROLE_ARN environment variable not set"; exit 1; }
45

56
VERSION=$(git describe --tags --abbrev=0)
67
HEAD_COMMIT=$(git rev-parse HEAD)
@@ -13,6 +14,10 @@ fi
1314

1415
echo "most recent tag: $VERSION (sha=$VERSION_COMMIT)"
1516

17+
SESSION_CREDS=$(aws sts assume-role --role-arn $PUBLISHING_ROLE_ARN --role-session-name publish-aws-kotlin-repo-tools)
18+
export AWS_ACCESS_KEY_ID=$(echo "${SESSION_CREDS}" | jq -r '.Credentials.AccessKeyId')
19+
export AWS_SECRET_ACCESS_KEY=$(echo "${SESSION_CREDS}" | jq -r '.Credentials.SecretAccessKey')
20+
export AWS_SESSION_TOKEN=$(echo "${SESSION_CREDS}" | jq -r '.Credentials.SessionToken')
1621
export RELEASE_S3_URL="s3://$RELEASE_BUCKET/releases"
1722

1823
TEST_KEY="releases/aws/sdk/kotlin/gradle/build-support/$VERSION/build-support-$VERSION.jar"
@@ -23,7 +28,8 @@ if aws s3api head-object --bucket $RELEASE_BUCKET --key $TEST_KEY; then
2328
fi
2429

2530
echo "releasing version $VERSION"
31+
exit 1
2632

27-
./gradlew -Prelease.version=$VERSION publishAllPublicationsToReleaseRepository
33+
#./gradlew -Prelease.version=$VERSION publishAllPublicationsToReleaseRepository
2834

2935

0 commit comments

Comments
 (0)