From 2d30c1b64c9baaae3c40be441ecc0ee1409a483d Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 31 Jan 2024 04:56:20 -0700 Subject: [PATCH 1/4] Update for `gradle/actions@v3.0.0` release - Bump version hashes to use `v3.0.0` of Gradle action - Bump to Node20-compatible versions of `actions/checkout` and `actions/setup-java` - Replace uses of `gradle/gradle-build-action` with `gradle/actions/setup-gradle` - Split "Setup Gradle" step out of "Run Gradle" steps - Add separate Job using `gradle/actions/dependency-submission` (flagged as optional) - Bump to setup JDK 17 --- ci/gradle-publish.yml | 19 +++++++++---------- ci/gradle.yml | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/ci/gradle-publish.yml b/ci/gradle-publish.yml index 3e30133..6cc37c3 100644 --- a/ci/gradle-publish.yml +++ b/ci/gradle-publish.yml @@ -20,26 +20,25 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file + - name: Setup Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 + - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: build + run: ./gradlew build # The USERNAME and TOKEN need to correspond to the credentials environment variables used in # the publishing section of your build.gradle - name: Publish to GitHub Packages - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: publish + run: ./gradlew publish env: USERNAME: ${{ github.actor }} TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ci/gradle.yml b/ci/gradle.yml index 51645f9..499f3a2 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -13,22 +13,41 @@ on: pull_request: branches: [ $default-branch ] -permissions: - contents: read - jobs: build: runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 + - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + run: ./gradlew build + + # Optional: Uploads the full dependency graph to GitHub to enable Dependabot alerts + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - arguments: build + java-version: '17' + distribution: 'temurin' + + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 From b0b88404ff0b2033d82041240d19b4b887d576a7 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 31 Jan 2024 13:29:02 -0700 Subject: [PATCH 2/4] Improve documentation in starter workflow - Remove "optional" flag from dependency-submission - Add example of running without Gradle wrapper - Link to action docs --- ci/gradle.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ci/gradle.yml b/ci/gradle.yml index 499f3a2..db5eacf 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -28,13 +28,26 @@ jobs: java-version: '17' distribution: 'temurin' + # Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - name: Setup Gradle uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 - - name: Build with Gradle + - name: Build with Gradle Wrapper run: ./gradlew build - # Optional: Uploads the full dependency graph to GitHub to enable Dependabot alerts + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration + # to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 + # with: + # gradle-version: '8.5' + # + # - name: Build with Gradle 8.5 + # run: gradle build + dependency-submission: runs-on: ubuntu-latest @@ -49,5 +62,7 @@ jobs: java-version: '17' distribution: 'temurin' + # Genereates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 From 51848d8b1567905ff32bd182801935475eaeab33 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 31 Jan 2024 13:36:52 -0700 Subject: [PATCH 3/4] Remove trailing whitespace --- ci/gradle.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/gradle.yml b/ci/gradle.yml index db5eacf..cee4eed 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -37,8 +37,7 @@ jobs: run: ./gradlew build # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). - # If your project does not have the Gradle Wrapper configured, you can use the following configuration - # to run Gradle with a specified version. + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. # # - name: Setup Gradle # uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 @@ -47,7 +46,7 @@ jobs: # # - name: Build with Gradle 8.5 # run: gradle build - + dependency-submission: runs-on: ubuntu-latest From 6c7819814a50a3f71ff124d8a6a0a53a4a574df7 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 31 Jan 2024 15:07:12 -0700 Subject: [PATCH 4/4] Fix typo --- ci/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/gradle.yml b/ci/gradle.yml index cee4eed..361a5d5 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -61,7 +61,7 @@ jobs: java-version: '17' distribution: 'temurin' - # Genereates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0