Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions .github/actions/configure-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@ runs:
shell: bash
run: |
cd ${{ inputs.working-directory }}
gradleVersion=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p')
echo Configuring custom Gradle distribution URL with version: $gradleVersion
echo gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip

GRADLE_VERSION=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | 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
echo Setting distribution URL to: $CUSTOM_URL

# Detect OS and set appropriate sed option
if sed --version 2>/dev/null | grep -q "GNU sed"; then
SED_CMD="sed -i" # GNU sed (Linux)
else
SED_CMD="sed -i ''" # BSD sed (macOS)
fi

# Replace the line containing "distributionUrl" with the new distributionUrl
$SED_CMD "/distributionUrl/c\\
distributionUrl=$CUSTOM_URL\\
" ./gradle/wrapper/gradle-wrapper.properties
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading