Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2b369e4
ready for test
0marperez Nov 17, 2025
200d09e
test setup complete
0marperez Nov 17, 2025
6427431
configure git
0marperez Nov 17, 2025
6274e15
don't sign commits?
0marperez Nov 17, 2025
4465d47
use PAT?
0marperez Nov 17, 2025
5004b9d
updated PAT && stopped running actual releases
0marperez Nov 17, 2025
cbd31c5
use GH token like error message said
0marperez Nov 17, 2025
cfb516d
ensue retryability when creating PRs
0marperez Nov 17, 2025
24b5e99
fix git pulls?
0marperez Nov 17, 2025
42b30a9
force push?
0marperez Nov 17, 2025
e69e114
add body to pr
0marperez Nov 17, 2025
7020c66
add no-changelog label
0marperez Nov 17, 2025
057bfaa
avoid try create multiple PR
0marperez Nov 17, 2025
f5dd697
fix typo
0marperez Nov 17, 2025
d626025
try de-duplicating git config
0marperez Nov 17, 2025
a1ec23c
nevermind, add back git config
0marperez Nov 17, 2025
c590a3c
check if previous PR is open
0marperez Nov 17, 2025
7f7ad25
try commonizing?
0marperez Nov 17, 2025
eb5e43c
fix typo
0marperez Nov 17, 2025
4f72ec8
fix syntax issue
0marperez Nov 17, 2025
0dd17c6
fix more syntax issues
0marperez Nov 17, 2025
0fd3993
remove testing code
0marperez Nov 17, 2025
e117242
remove kn logic
0marperez Nov 17, 2025
831ebc9
PR feedback
0marperez Nov 18, 2025
744b5bc
test setup
0marperez Nov 18, 2025
bb2e9c4
fix typo
0marperez Nov 18, 2025
8ea2fb4
fix issues with new action path
0marperez Nov 18, 2025
c26e2ce
try pop and push
0marperez Nov 18, 2025
f90b7c1
fix actual mistake
0marperez Nov 18, 2025
bb86cb5
remove test setup
0marperez Nov 18, 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
53 changes: 53 additions & 0 deletions .github/actions/version-bump-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Post release downstream version bump
description: Creates a version bump PR of repo tools in the specified downstream repo

inputs:
repo:
description: Downstream repo name
required: true
version:
description: Repo tools version for pull request
required: true
pat:
description: A GitHub personal access token used to authenticate the requests in this action
required: true

runs:
using: composite
steps:
- name: Checkout SDK
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
path: ${{ inputs.repo }}
token: ${{ inputs.pat }}

- name: Create pull request
shell: bash
env:
REPO: ${{ inputs.repo }}
NEW_VERSION: ${{ inputs.version }}
GH_TOKEN: ${{ inputs.pat }}
run: |
BRANCH=repo-tools-$NEW_VERSION
cd $REPO
git branch $BRANCH
git checkout $BRANCH
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can be simplified:

git checkout -b $BRANCH

git config user.name aws-sdk-kotlin-ci
git config user.email "[email protected]"
sed -i "s/aws-kotlin-repo-tools-version = .*/aws-kotlin-repo-tools-version = \"$NEW_VERSION\"/" gradle/libs.versions.toml
git add gradle/libs.versions.toml
git commit -m "misc: repo tools v$NEW_VERSION"
git push --force --set-upstream origin $BRANCH
EXISTING_PR=$(gh pr list --head "$BRANCH" --state open --json number -q '.[0].number')
if [ -z "$EXISTING_PR" ]; then
PR_URL=$(gh pr create --title "misc: repo tools v$NEW_VERSION" --body "Bumps repo tools to v$NEW_VERSION")
PR_NUMBER=$(basename $PR_URL)
gh pr edit $PR_NUMBER --add-label "no-changelog"
fi
Comment on lines 25 to 67
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: It would be nice to see some logs from this action which could assist in debugging. Offhand, I might suggest dumping the libs.versions.toml file after modification, showing the URLs to the new or existing PRs, emitting a warning when the user checked the box for a repo but that repo already has an open PR, etc.

49 changes: 41 additions & 8 deletions .github/workflows/run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ on:
type: string
required: false
description: 'Optionally specify a custom release version (minor version bump e.g.)'
kn-release:
sdk-version-bump:
type: boolean
required: false
default: false
description: 'Whether the release is a KN variant of repo tools or not'
description: 'Whether to create an SDK version bump pull request for this release'
smithy-kotlin-version-bump:
type: boolean
required: false
default: false
description: 'Whether to create a Smithy Kotlin version bump pull request for this release'
crt-kotlin-version-bump:
type: boolean
required: false
default: false
description: 'Whether to create an CRT Kotlin version bump pull request for this release'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "an CRT" → "a CRT"


permissions:
id-token: write
Expand All @@ -35,11 +45,7 @@ jobs:
exit 0
fi

if [ "${{ inputs.kn-release }}" == "true" ]; then
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -- '-kn$' | head -n 1)
else
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -v -- '-kn$' | head -n 1)
fi
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -- '-kn$' | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Correctness: This retains the old logic for determining the previous K/N version number, which is not what we want. Since we're not cutting -kn releases anymore, we should probably just remove the grep filter altogether:

CURRENT_VERSION=$(git tag --sort=-creatordate | head -n1)


IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
PATCH_NUMBER=${PATCH%%[^0-9]*}
Expand All @@ -63,12 +69,39 @@ jobs:
aws-region: us-west-2

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

- name: AWS SDK Kotlin pull request
if: ${{ inputs.sdk-version-bump == 'true' }}
uses: aws/aws-kotlin-repo-tools/.github/actions/version-bump-pr@main
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: We should use the syntax for actions in the same repository:

uses: ./.github/actions/version-bump-pr

with:
repo: 'aws/aws-sdk-kotlin'
version: ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
pat: ${{ secrets.CI_USER_PAT }}

- name: Smithy Kotlin pull request
if: ${{ inputs.smithy-kotlin-version-bump == 'true' }}
uses: aws/aws-kotlin-repo-tools/.github/actions/version-bump-pr@main
with:
repo: 'smithy-lang/smithy-kotlin'
version: ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
pat: ${{ secrets.CI_USER_PAT }}

- name: CRT Kotlin pull request
if: ${{ inputs.crt-kotlin-version-bump == 'true' }}
uses: aws/aws-kotlin-repo-tools/.github/actions/version-bump-pr@main
with:
repo: 'aws/aws-crt-kotlin'
version: ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
pat: ${{ secrets.CI_USER_PAT }}

- name: Delete failed release tag
if: ${{ failure() }}
run: |
git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
if [ "${{ steps.release-job.outcome }}" != "success" ]; then
git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Move the bash if up into the step if: by using failure with conditions:

- name: Delete failed release tag
  if: ${{ failure() && steps.release-job.outcome != 'success' }}
  run: |
    git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}

Loading