generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: release workflow #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
0f438ba
feat: release workflow
0marperez 08a93fb
fix syntax errors
0marperez a4cf081
fetch tags
0marperez 200fd43
fetch origin instead ?
0marperez f0e45e4
fetch origin and tags
0marperez 5972cf9
try fetch depth 0
0marperez a5bd704
debugging
0marperez c14127b
change way to get latest tag
0marperez 7a3758c
dry run release
0marperez f2b0189
try run actual release
0marperez cc42b4a
configure gradle and aws credentials
0marperez 7d554fb
configure OIDC
0marperez 0cb4dc9
trigger CI?
0marperez ae6f560
give back write pemissions
0marperez c47bd2f
fix credentials?
0marperez 26f0428
fix head object call
0marperez 180fa6f
prepare for review
0marperez d6b7610
test codebuild invocation
0marperez 3d1dc93
add pull request trigger
0marperez 5054267
revert release script to original
0marperez 1c1f12e
get ready for review
0marperez 1a6e6e3
add back newlines
0marperez 86722b5
test syntax for separate kn and regular releases
0marperez df8de1b
remove test code
0marperez ebe6569
update release instructions
0marperez faa983d
cleanup and test
0marperez 72437a9
debug patch issues
0marperez 2148fd4
fix issues and test
0marperez eaf34d0
fix issues and test v2
0marperez 536f5c7
remove test code
0marperez 432b581
remove test code v2
0marperez 19f22e4
pr review fixes
0marperez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
|
|
||
| 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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
-knvariant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-knvariants are temprorary right? How much longer do you think we'll have them for? We can use the version overrideThere was a problem hiding this comment.
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
-knsuffixes. But right now if I release a-knvariant, then go to run this new script, won't it crash/misbehave when trying to add 1 to the patch version?