Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0f438ba
feat: release workflow
0marperez May 15, 2025
08a93fb
fix syntax errors
0marperez May 15, 2025
a4cf081
fetch tags
0marperez May 15, 2025
200fd43
fetch origin instead ?
0marperez May 15, 2025
f0e45e4
fetch origin and tags
0marperez May 15, 2025
5972cf9
try fetch depth 0
0marperez May 15, 2025
a5bd704
debugging
0marperez May 15, 2025
c14127b
change way to get latest tag
0marperez May 15, 2025
7a3758c
dry run release
0marperez May 15, 2025
f2b0189
try run actual release
0marperez May 15, 2025
cc42b4a
configure gradle and aws credentials
0marperez May 15, 2025
7d554fb
configure OIDC
0marperez May 15, 2025
0cb4dc9
trigger CI?
0marperez May 15, 2025
ae6f560
give back write pemissions
0marperez May 15, 2025
c47bd2f
fix credentials?
0marperez May 15, 2025
26f0428
fix head object call
0marperez May 15, 2025
180fa6f
prepare for review
0marperez May 15, 2025
d6b7610
test codebuild invocation
0marperez May 15, 2025
3d1dc93
add pull request trigger
0marperez May 15, 2025
5054267
revert release script to original
0marperez May 15, 2025
1c1f12e
get ready for review
0marperez May 15, 2025
1a6e6e3
add back newlines
0marperez May 15, 2025
86722b5
test syntax for separate kn and regular releases
0marperez May 16, 2025
df8de1b
remove test code
0marperez May 16, 2025
ebe6569
update release instructions
0marperez May 19, 2025
faa983d
cleanup and test
0marperez Jun 17, 2025
72437a9
debug patch issues
0marperez Jun 17, 2025
2148fd4
fix issues and test
0marperez Jun 17, 2025
eaf34d0
fix issues and test v2
0marperez Jun 17, 2025
536f5c7
remove test code
0marperez Jun 17, 2025
432b581
remove test code v2
0marperez Jun 17, 2025
19f22e4
pr review fixes
0marperez Jun 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/run-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
workflow_dispatch:
inputs:
version-override:
type: string
required: false
description: 'Optionally specify a custom release version (minor version bump e.g.)'

permissions:
id-token: write
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Resolve version
id: resolve-version
run: |
if [ -n "${{ inputs.version-override }}" ]; then
echo "NEW_VERSION=${{ inputs.version-override }}" >> "$GITHUB_OUTPUT"
exit 0
fi

CURRENT_VERSION=$(git tag --sort=-creatordate | head -n 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correctness: What if the latest tag is a -kn variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-kn variants are temprorary right? How much longer do you think we'll have them for? We can use the version override

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say for sure when we'll stop using -kn suffixes. But right now if I release a -kn variant, then go to run this new script, won't it crash/misbehave when trying to add 1 to the patch version?


IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
PATCH=$((PATCH + 1))
RESOLVED_VERSION="$MAJOR.$MINOR.$PATCH"

echo "NEW_VERSION=$RESOLVED_VERSION" >> "$GITHUB_OUTPUT"

- name: Configure git
run: |
git config user.name aws-sdk-kotlin-ci
git config user.email "[email protected]"

- name: Create tag
env:
NEW_VERSION: ${{ steps.resolve-version.outputs.NEW_VERSION }}
run: |
git tag "$NEW_VERSION"
git push origin "$NEW_VERSION"

- name: Configure Gradle
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PUBLISHING_ROLE_ARN }}
aws-region: us-west-2

- name: Run CodeBuild
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: publish-aws-kotlin-repo-tools
source-version-override: ${{ steps.resolve-version.outputs.NEW_VERSION }}

- name: Delete failed release tag
if: ${{ failure() }}
run: |
git push --delete origin ${{ steps.resolve-version.outputs.NEW_VERSION }}
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export AWS_SECRET_ACCESS_KEY=$(echo "${SESSION_CREDS}" | jq -r '.Credentials.Sec
export AWS_SESSION_TOKEN=$(echo "${SESSION_CREDS}" | jq -r '.Credentials.SessionToken')
export RELEASE_S3_URL="s3://$RELEASE_BUCKET/releases"

TEST_KEY="releases/aws/sdk/kotlin/build-plugins/$VERSION/build-plugins-$VERSION.jar"
TEST_KEY="releases/aws/sdk/kotlin/gradle/build-support/$VERSION/build-support-$VERSION.jar"

if aws s3api head-object --bucket $RELEASE_BUCKET --key $TEST_KEY; then
echo "failing release; $VERSION already exists!"
Expand Down