Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
67 changes: 67 additions & 0 deletions .github/actions/version-bump-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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
echo "Creating branch: $BRANCH"
git checkout -b $BRANCH

echo "Configuring git"
git config user.name aws-sdk-kotlin-ci
git config user.email "[email protected]"

echo "Modifying version catalog to use repo tools $NEW_VERSION"
sed -i "s/aws-kotlin-repo-tools-version = .*/aws-kotlin-repo-tools-version = \"$NEW_VERSION\"/" gradle/libs.versions.toml

echo "Modified version catalog:"
cat gradle/libs.versions.toml

echo "Commiting modifications"
git add gradle/libs.versions.toml
git commit -m "misc: repo tools v$NEW_VERSION"

echo "Pushing changes upstream"
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
echo "Creating pull request"
PR_URL=$(gh pr create --title "misc: repo tools v$NEW_VERSION" --body "Bumps repo tools to v$NEW_VERSION")
echo "Pull request created: $PR_URL"

echo "Adding no-changelog label"
PR_NUMBER=$(basename $PR_URL)
gh pr edit $PR_NUMBER --add-label "no-changelog"
else
echo "::warning::Existing pull request found: $EXISTING_PR"
fi
47 changes: 39 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 a CRT Kotlin version bump pull request for this release'

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 | head -n 1)

IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
PATCH_NUMBER=${PATCH%%[^0-9]*}
Expand All @@ -63,12 +69,37 @@ 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: ./.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: ./.github/actions/version-bump-pr
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: ./.github/actions/version-bump-pr
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() }}
if: ${{ failure() && steps.release-job.outcome != 'success' }}
run: |
git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
Loading