From 8114d71d1126ed6ce6f462d5a365c26e83126bbd Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 20 Sep 2023 22:49:37 +0200 Subject: [PATCH 1/4] chore(GitHub): Give a job step a more general name This does more than just restoring the Gradle cache, e.g. it does also configure environment variables. Signed-off-by: Sebastian Schuberth --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c18f68697b801..11c5fc2c36230 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -151,7 +151,7 @@ jobs: with: distribution: temurin java-version: 17 - - name: Restore Gradle cache entries + - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Validate Batect wrapper scripts uses: batect/batect-wrapper-validation-action@v0 From 5c36c443f17ca689a86509f86b9ff93152ccca73 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 20 Sep 2023 22:53:17 +0200 Subject: [PATCH 2/4] chore(GitHub): Also clean-up the Gradle home for `funTest-docker` Signed-off-by: Sebastian Schuberth --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 11c5fc2c36230..566ffa3e3f6a3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -153,6 +153,8 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true - name: Validate Batect wrapper scripts uses: batect/batect-wrapper-validation-action@v0 - name: Run functional tests that do require external tools From f34c57561dc575e9844c3793e0bcee20e09dfd24 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 20 Sep 2023 22:55:07 +0200 Subject: [PATCH 3/4] refactor(GitHub): Setup Gradle only once Follow the recommendation from [1] and setup Gradle only once, with subsquent steps invoking Gradle directly with a `run` step. [1]: https://github.com/gradle/gradle-build-action/blob/main/README.md#use-the-action-to-setup-gradle Signed-off-by: Sebastian Schuberth --- .github/workflows/release.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a8322d527066..da87f8782cd98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,21 +28,19 @@ jobs: with: distribution: temurin java-version: 17 - - name: Publish to OSSRH + - name: Setup Gradle uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Publish to OSSRH env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - with: - gradle-home-cache-cleanup: true - arguments: publishAllPublicationsToOSSRHRepository + run: ./gradlew publishAllPublicationsToOSSRHRepository - name: Build ORT Distributions - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :cli:distZip :helper-cli:distZip + run: ./gradlew :cli:distZip :helper-cli:distZip - name: Create GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 952d0e97a3eacb713a19e6cc7cfe856e40660d5d Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 20 Sep 2023 17:55:49 +0200 Subject: [PATCH 4/4] build(GitHub): Add a step to create release notes This requires infinite fetch depth to be sure to get all tags. Signed-off-by: Sebastian Schuberth --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da87f8782cd98..25056f4220fc4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.ORT_VERSION }} + fetch-depth: 0 - name: Setup Java uses: actions/setup-java@v3 with: @@ -41,8 +42,11 @@ jobs: run: ./gradlew publishAllPublicationsToOSSRHRepository - name: Build ORT Distributions run: ./gradlew :cli:distZip :helper-cli:distZip + - name: Generate Release Notes + run: ./gradlew -q printChangeLog > RELEASE_NOTES.md - name: Create GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create $ORT_VERSION ./cli/build/distributions/ort-$ORT_VERSION.zip ./helper-cli/build/distributions/orth-$ORT_VERSION.zip + gh release create $ORT_VERSION --notes-file RELEASE_NOTES.md \ + ./cli/build/distributions/ort-$ORT_VERSION.zip ./helper-cli/build/distributions/orth-$ORT_VERSION.zip