Skip to content

Commit 660fa7c

Browse files
committed
feat: create & test cross-repo action to configure gradle
1 parent 2fd08c5 commit 660fa7c

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Configure Gradle
2+
description: >
3+
Configures Gradle for use in CI
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Configure custom Gradle distribution URL
9+
shell: zsh
10+
run: |
11+
gradleVersion=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p')
12+
echo Configuring custom Gradle distribution URL with version: $gradleVersion
13+
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ jobs:
2828
restore-keys: |
2929
${{ runner.os }}-gradle-
3030
- name: Configure Gradle
31-
run: |
32-
# Keep gradle version in sync with aws-kotlin-repo-tools/gradle/wrapper/gradle-wrapper.properties
33-
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-8.12-bin.zip
31+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
3432
- name: Build and Test ${{ env.PACKAGE_NAME }}
3533
run: |
3634
./gradlew build
@@ -49,9 +47,7 @@ jobs:
4947
restore-keys: |
5048
${{ runner.os }}-gradle-
5149
- name: Configure Gradle
52-
run: |
53-
# Keep gradle version in sync with aws-kotlin-repo-tools/gradle/wrapper/gradle-wrapper.properties
54-
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-8.12-bin.zip
50+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
5551
- name: Build and Test ${{ env.PACKAGE_NAME }}
5652
run: |
5753
./gradlew build
@@ -62,9 +58,7 @@ jobs:
6258
- name: Checkout sources
6359
uses: actions/checkout@v2
6460
- name: Configure Gradle
65-
run: |
66-
# Keep gradle version in sync with aws-kotlin-repo-tools/gradle/wrapper/gradle-wrapper.properties
67-
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-8.12-bin.zip
61+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@mainp
6862
- name: Build and Test ${{ env.PACKAGE_NAME }}
6963
run: |
7064
./gradlew build

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ jobs:
2020
uses: actions/checkout@v2
2121
- name: Configure Gradle
2222
run: |
23-
# Keep gradle version in sync with aws-kotlin-repo-tools/gradle/wrapper/gradle-wrapper.properties
24-
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-8.12-bin.zip
23+
gradleVersion=$(grep "distributionUrl" ./gradle/wrapper/gradle-wrapper.properties | sed -n 's|.*gradle-\([0-9.]*\)-bin.zip|\1|p')
24+
echo Configuring custom Gradle distribution URL with version: $gradleVersion
25+
gradle wrapper --gradle-distribution-url https://d2pjps8lqszrgq.cloudfront.net/gradle-$gradleVersion-bin.zip
2526
- name: Lint ${{ env.PACKAGE_NAME }}
2627
run: |
2728
./gradlew ktlint

0 commit comments

Comments
 (0)