From 8ae92788906c666572ead0315f89ea7b2dbad31f Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 14 Feb 2025 13:53:14 -0500 Subject: [PATCH 1/4] feat: de-configure Gradle action --- .github/actions/configure-gradle/action.yml | 5 ++++- .../actions/de-configure-gradle/action.yml | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/actions/de-configure-gradle/action.yml diff --git a/.github/actions/configure-gradle/action.yml b/.github/actions/configure-gradle/action.yml index cac7f4a..e6c47d1 100644 --- a/.github/actions/configure-gradle/action.yml +++ b/.github/actions/configure-gradle/action.yml @@ -13,7 +13,10 @@ runs: run: | cd ${{ inputs.working-directory }} - GRADLE_VERSION=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p') + ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties) + echo "ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties)" >> $GITHUB_ENV + + GRADLE_VERSION=$(echo $ORIGINAL_URL | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p') CUSTOM_URL="https://d2pjps8lqszrgq.cloudfront.net/gradle-$GRADLE_VERSION-bin.zip" echo Configuring custom Gradle distribution URL with version: $GRADLE_VERSION diff --git a/.github/actions/de-configure-gradle/action.yml b/.github/actions/de-configure-gradle/action.yml new file mode 100644 index 0000000..9366e5c --- /dev/null +++ b/.github/actions/de-configure-gradle/action.yml @@ -0,0 +1,21 @@ +name: De-configure Gradle +description: De-configures Gradle for use in CI +inputs: + working-directory: + description: The directory in which to run the action + default: . + +runs: + using: composite + steps: + - name: De-configure custom Gradle distribution URL + shell: bash + run: | + cd ${{ inputs.working-directory }} + + echo Setting distribution URL to: $ORIGINAL_URL + + # Replace the line containing "distributionUrl" with the original distributionUrl + $SED_CMD "/distributionUrl/c\\ + $ORIGINAL_URL\\ + " ./gradle/wrapper/gradle-wrapper.properties \ No newline at end of file From 441a9b0badd54d60d361658f7a970eccf137f6ea Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 14 Feb 2025 13:56:21 -0500 Subject: [PATCH 2/4] misc: get rid of code duplication --- .github/actions/configure-gradle/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/configure-gradle/action.yml b/.github/actions/configure-gradle/action.yml index e6c47d1..06ab655 100644 --- a/.github/actions/configure-gradle/action.yml +++ b/.github/actions/configure-gradle/action.yml @@ -14,7 +14,7 @@ runs: cd ${{ inputs.working-directory }} ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties) - echo "ORIGINAL_URL=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties)" >> $GITHUB_ENV + echo "ORIGINAL_URL=$ORIGINAL_URL" >> $GITHUB_ENV GRADLE_VERSION=$(echo $ORIGINAL_URL | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p') CUSTOM_URL="https://d2pjps8lqszrgq.cloudfront.net/gradle-$GRADLE_VERSION-bin.zip" From 1e37c3f8a8ab879dac6b03679f20e90bf0ffe3fa Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 14 Feb 2025 14:06:27 -0500 Subject: [PATCH 3/4] misc: use 'restore' rather than 'de-configure' --- .github/actions/de-configure-gradle/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/de-configure-gradle/action.yml b/.github/actions/de-configure-gradle/action.yml index 9366e5c..c38f8ea 100644 --- a/.github/actions/de-configure-gradle/action.yml +++ b/.github/actions/de-configure-gradle/action.yml @@ -1,5 +1,5 @@ -name: De-configure Gradle -description: De-configures Gradle for use in CI +name: Restore Gradle +description: Restores Gradle configuration to its original state inputs: working-directory: description: The directory in which to run the action @@ -8,7 +8,7 @@ inputs: runs: using: composite steps: - - name: De-configure custom Gradle distribution URL + - name: Restore Gradle distribution URL shell: bash run: | cd ${{ inputs.working-directory }} From 8e21b86716c1f00e7e3414d341fbc4cd6b2b23a1 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 14 Feb 2025 14:20:57 -0500 Subject: [PATCH 4/4] fix: rename file to use restore as well --- .../actions/{de-configure-gradle => restore-gradle}/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{de-configure-gradle => restore-gradle}/action.yml (100%) diff --git a/.github/actions/de-configure-gradle/action.yml b/.github/actions/restore-gradle/action.yml similarity index 100% rename from .github/actions/de-configure-gradle/action.yml rename to .github/actions/restore-gradle/action.yml