Skip to content

Commit

Permalink
Update gradle workflow (#73)
Browse files Browse the repository at this point in the history
Updates gradle workflow to check for tags on the smithy-gradle-plugin package and only update gradle.properties files.
  • Loading branch information
hpmellema authored Feb 14, 2024
1 parent a8f14cf commit 7d090fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/update-smithy-gradle-plugin-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
id: fetch-latest
run: |
echo "latestSmithyGradle=$( \
curl -sL https://plugins.gradle.org/m2/software/amazon/smithy/smithy-gradle-plugin/maven-metadata.xml | \
grep latest | cut -d'>' -f2 | cut -d'<' -f1)" >> $GITHUB_OUTPUT
curl -sL https://api.github.com/repos/smithy-lang/smithy-gradle-plugin/tags | \
jq -r '.[0].name')" >> $GITHUB_OUTPUT
- name: Get current version
id: get-current
Expand Down Expand Up @@ -46,18 +46,11 @@ jobs:
find . -type f -name 'gradle.properties' \
-exec sed -i "s|smithyGradleVersion=${{ steps.get-current.outputs.smithyGradleVersion }}|smithyGradleVersion=${{ steps.fetch-latest.outputs.latestSmithyGradle }}|g" {} \;
- name: Find and replace gradle plugin versions in build files
id: sync-plugin-version
if: steps.update-check.outputs.update-required == 'true'
run: |
find . -type f -name 'build.gradle.kts' \
-exec sed -i '' "s/\(id(\"software\.amazon\.smithy\.gradle\.smithy-\([[:lower:]]*\)\")\.version(\"\)\([[:digit:]\.]*\)\")/\\1${{ steps.fetch-latest.outputs.latestSmithyGradle }}\")/" {} \;
- name: Create PR
if: steps.update-check.outputs.update-required == 'true'
run: |
git add .
git commit -m 'Update smithy-gradle Version'
git commit -m 'Update smithy-gradle-plugin Version'
git push --set-upstream origin "automation/bump-smithy-gradle-version/${{ steps.fetch-latest.outputs.latestSmithyGradle }}"
gh pr create \
--title "[Automation] smithy-gradle-plugin Version Bump - \`${{ steps.fetch-latest.outputs.latestSmithyGradle }}\`" \
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
smithyVersion=1.44.0
smithyGradleVersion=0.10.0
smithyGradleVersion=0.9.0
2 changes: 1 addition & 1 deletion quickstart-examples/quickstart-gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
smithyVersion=1.44.0
smithyGradleVersion=0.10.0
smithyGradleVersion=0.9.0

0 comments on commit 7d090fb

Please sign in to comment.