From 93bd71bbaaa80134d8980701dfb2e8b1249f821a Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 18:12:50 +0200 Subject: [PATCH 01/39] Split test --- .github/workflows/java-gradle-docker.yaml | 28 +++++-- .github/workflows/java-gradle-library.yaml | 26 ++++-- .github/workflows/java-gradle-plugin.yaml | 26 ++++-- .../java-gradle-assess-code-quality/README.md | 40 +++++++++ .../action.yaml | 82 +++++++++++++++++++ actions/java-gradle-test/README.md | 29 ++----- actions/java-gradle-test/action.yaml | 57 +++---------- 7 files changed, 195 insertions(+), 93 deletions(-) create mode 100644 actions/java-gradle-assess-code-quality/README.md create mode 100644 actions/java-gradle-assess-code-quality/action.yaml diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 7294e39f9..21fe9f3df 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -84,25 +84,35 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test + name: Test and asses code quality runs-on: ubuntu-22.04 needs: build steps: - name: Test - uses: bakdata/ci-templates/actions/java-gradle-test@v1.16.0 + uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: - sonar-token: ${{ secrets.sonar-token }} - sonar-organization: ${{ secrets.sonar-organization }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} + gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} + working-directory: ${{ inputs.working-directory }} + - name: Access code quality + uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 + with: gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} - + build-jib: name: Build tarball image runs-on: ubuntu-22.04 diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index c7c3eeecc..8618d1084 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -74,23 +74,33 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test + name: Test and asses code quality runs-on: ubuntu-22.04 needs: build steps: - name: Test - uses: bakdata/ci-templates/actions/java-gradle-test@v1.16.0 + uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: - sonar-token: ${{ secrets.sonar-token }} - sonar-organization: ${{ secrets.sonar-organization }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} + gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} + working-directory: ${{ inputs.working-directory }} + - name: Access code quality + uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 + with: gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} publish: diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index eec4c3980..dc997f8a8 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -80,23 +80,33 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test + name: Test and asses code quality runs-on: ubuntu-22.04 needs: build steps: - name: Test - uses: bakdata/ci-templates/actions/java-gradle-test@v1.16.0 + uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: - sonar-token: ${{ secrets.sonar-token }} - sonar-organization: ${{ secrets.sonar-organization }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} + gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} + working-directory: ${{ inputs.working-directory }} + - name: Access code quality + uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 + with: gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} publish: diff --git a/actions/java-gradle-assess-code-quality/README.md b/actions/java-gradle-assess-code-quality/README.md new file mode 100644 index 000000000..b45a3f964 --- /dev/null +++ b/actions/java-gradle-assess-code-quality/README.md @@ -0,0 +1,40 @@ +# assess-code-quality + +This action assess code quality and tests signing for Sonatype. + +## Input Parameters + +If you do not set input parameters for publishing code quality test results on Sonarcloud or for testing the signing for +Sonatype, then these steps are skipped. + +| Name | Required | Default Value | Type | Description | +| ----------------------- | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| sonar-organization | ❌ | - | string | Organization for Sonarcloud | +| sonar-token | ❌ | - | string | Token for Sonarcloud | +| signing-key-id | ❌ | - | string | Key id for signing the Sonatype publication | +| signing-password | ❌ | - | string | Password for signing the Sonatype publication | +| signing-secret-key-ring | ❌ | - | string | Key ring (base64 encoded) for signing the Sonatype publication | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | + +## Usage + +```yaml +steps: + - name: Test + uses: bakdata/ci-templates/actions/java-gradle-test@main + with: + sonar-token: ${{ secrets.sonar-token }} # (Optional) If not set, code quality tests are skipped + sonar-organization: ${{ secrets.sonar-organization }} # (Optional) If not set, code quality tests are skipped + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} # (Optional) If not set, signing for Sonatype is not tested + signing-key-id: ${{ secrets.signing-key-id }} # (Optional) If not set, signing for Sonatype is not tested + signing-password: ${{ secrets.signing-password }} # (Optional) If not set, signing for Sonatype is not tested + java-distribution: "microsoft" # (Optional) + java-version: "11" # (Optional) + gradle-version: "wrapper" # (Optional) + working-directory: "." # (Optional) +``` diff --git a/actions/java-gradle-assess-code-quality/action.yaml b/actions/java-gradle-assess-code-quality/action.yaml new file mode 100644 index 000000000..09aec8e46 --- /dev/null +++ b/actions/java-gradle-assess-code-quality/action.yaml @@ -0,0 +1,82 @@ +name: "Assess code quality" +description: "Assess code quality and optionally test signing for Sonatype" + +inputs: + download-lfs-files: + description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" + required: false + default: false + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + default: true + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + default: "wrapper" + java-distribution: + description: "Java distribution to be installed. (Default is microsoft)" + required: false + default: "microsoft" + java-version: + description: "Java version to be installed. (Default is 11)" + required: false + default: "11" + signing-key-id: + description: "Key id for signing the Sonatype publication." + required: false + signing-password: + description: "Password for signing the Sonatype publication." + required: false + signing-secret-key-ring: + description: "Key ring (base64 encoded) for signing the Sonatype publication." + required: false + sonar-organization: + description: "Organization for Sonarcloud." + required: false + sonar-token: + description: "Token for Sonarcloud." + required: false + working-directory: + description: "Working directory of your Gradle artifacts. (Default is .)" + required: false + default: "." + +runs: + using: "composite" + steps: + - name: Check out repository + uses: bakdata/ci-templates/actions/checkout@1.32.0 + with: + fetch-depth: 0 + lfs: ${{ inputs.download-lfs-files }} + + - name: Set up Gradle with version ${{ inputs.gradle-version }} + uses: bakdata/ci-templates/actions/java-gradle-setup@v1.16.0 + with: + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + + # sonar.branch.autoconfig.disabled is necessary for autocreation of projects on Sonarcloud to work + - name: Assess code quality + if: ${{ inputs.sonar-token != '' && inputs.sonar-organization != '' }} + run: ./gradlew -Dsonar.branch.autoconfig.disabled=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=${{ inputs.sonar-organization }} --info --stacktrace sonarqube + shell: bash + working-directory: ${{ inputs.working-directory }} + env: + SONAR_TOKEN: ${{ inputs.sonar-token }} + + - name: Check if everything builds (incl. javadoc) for snapshot/release and signing works + if: ${{ inputs.signing-secret-key-ring != '' && inputs.signing-key-id != '' && inputs.signing-password != '' }} + run: | + export SIGNING_SECRET_KEY_RING_FILE="$(mktemp -d)/secring.gpg" + echo '${{ inputs.signing-secret-key-ring }}' | base64 -d > $SIGNING_SECRET_KEY_RING_FILE + ./gradlew --info --stacktrace signSonatypePublication + shell: bash + working-directory: ${{ inputs.working-directory }} + env: + SIGNING_KEY_ID: ${{ inputs.signing-key-id }} + SIGNING_PASSWORD: ${{ inputs.signing-password }} + CI: true diff --git a/actions/java-gradle-test/README.md b/actions/java-gradle-test/README.md index 9e7b7f252..5e0cfe0be 100644 --- a/actions/java-gradle-test/README.md +++ b/actions/java-gradle-test/README.md @@ -4,22 +4,14 @@ This action runs Junit tests, publishes the test results and tests signing for S ## Input Parameters -If you do not set input parameters for publishing code quality test results on Sonarcloud or for testing the signing for -Sonatype, then these steps are skipped. - -| Name | Required | Default Value | Type | Description | -| ----------------------- | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | -| sonar-token | ❌ | - | string | Token for Sonarcloud | -| sonar-organization | ❌ | - | string | Organization for Sonarcloud | -| signing-secret-key-ring | ❌ | - | string | Key ring (base64 encoded) for signing the Sonatype publication | -| signing-key-id | ❌ | - | string | Key id for signing the Sonatype publication | -| signing-password | ❌ | - | string | Password for signing the Sonatype publication | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | -| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | +| Name | Required | Default Value | Type | Description | +| ------------------ | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | ## Usage @@ -28,11 +20,6 @@ steps: - name: Test uses: bakdata/ci-templates/actions/java-gradle-test@main with: - sonar-token: ${{ secrets.sonar-token }} # (Optional) If not set, code quality tests are skipped - sonar-organization: ${{ secrets.sonar-organization }} # (Optional) If not set, code quality tests are skipped - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} # (Optional) If not set, signing for Sonatype is not tested - signing-key-id: ${{ secrets.signing-key-id }} # (Optional) If not set, signing for Sonatype is not tested - signing-password: ${{ secrets.signing-password }} # (Optional) If not set, signing for Sonatype is not tested java-distribution: "microsoft" # (Optional) java-version: "11" # (Optional) gradle-version: "wrapper" # (Optional) diff --git a/actions/java-gradle-test/action.yaml b/actions/java-gradle-test/action.yaml index 35ca026ff..375d7064e 100644 --- a/actions/java-gradle-test/action.yaml +++ b/actions/java-gradle-test/action.yaml @@ -1,22 +1,19 @@ name: "Test Java artiacts" -description: "Run Junit test, publish test results and optionally test signing for Sonatype" +description: "Run Junit test and publish test results" inputs: - sonar-token: - description: "Token for Sonarcloud." - required: false - sonar-organization: - description: "Organization for Sonarcloud." - required: false - signing-secret-key-ring: - description: "Key ring (base64 encoded) for signing the Sonatype publication." + download-lfs-files: + description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" required: false - signing-key-id: - description: "Key id for signing the Sonatype publication." + default: false + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" required: false - signing-password: - description: "Password for signing the Sonatype publication." + default: true + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" required: false + default: "wrapper" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -25,22 +22,10 @@ inputs: description: "Java version to be installed. (Default is 11)" required: false default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - default: true working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false default: "." - download-lfs-files: - description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" - required: false - default: false runs: using: "composite" @@ -69,25 +54,3 @@ runs: if: always() # always run even if the previous step fails with: report_paths: "**/build/test-results/test/TEST-*.xml" - - # sonar.branch.autoconfig.disabled is necessary for autocreation of projects on Sonarcloud to work - - name: Assess code quality - if: ${{ inputs.sonar-token != '' && inputs.sonar-organization != '' }} - run: ./gradlew -Dsonar.branch.autoconfig.disabled=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=${{ inputs.sonar-organization }} --info --stacktrace sonarqube - shell: bash - working-directory: ${{ inputs.working-directory }} - env: - SONAR_TOKEN: ${{ inputs.sonar-token }} - - - name: Check if everything builds (incl. javadoc) for snapshot/release and signing works - if: ${{ inputs.signing-secret-key-ring != '' && inputs.signing-key-id != '' && inputs.signing-password != '' }} - run: | - export SIGNING_SECRET_KEY_RING_FILE="$(mktemp -d)/secring.gpg" - echo '${{ inputs.signing-secret-key-ring }}' | base64 -d > $SIGNING_SECRET_KEY_RING_FILE - ./gradlew --info --stacktrace signSonatypePublication - shell: bash - working-directory: ${{ inputs.working-directory }} - env: - SIGNING_KEY_ID: ${{ inputs.signing-key-id }} - SIGNING_PASSWORD: ${{ inputs.signing-password }} - CI: true From 98a89aa7061ffe19cf9126559b6a5007204305b0 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 18:54:09 +0200 Subject: [PATCH 02/39] Split test --- .github/workflows/java-gradle-docker.yaml | 2 +- .github/workflows/java-gradle-library.yaml | 2 +- .github/workflows/java-gradle-plugin.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 21fe9f3df..a6a0adc6a 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -98,7 +98,7 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} - - name: Access code quality + - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 with: diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 8618d1084..f466fda79 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -88,7 +88,7 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} - - name: Access code quality + - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 with: diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index dc997f8a8..90b69f1c3 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -94,7 +94,7 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} - - name: Access code quality + - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 with: From 73ff8c24aac157664b2bbe87bdc6606660c1ec02 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 18:55:25 +0200 Subject: [PATCH 03/39] Split test --- .github/workflows/java-gradle-docker.yaml | 2 +- .github/workflows/java-gradle-library.yaml | 2 +- .github/workflows/java-gradle-plugin.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index a6a0adc6a..5075eb123 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -89,7 +89,7 @@ jobs: needs: build steps: - - name: Test + - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index f466fda79..406512b8f 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -79,7 +79,7 @@ jobs: needs: build steps: - - name: Test + - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 90b69f1c3..5422efaa7 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -85,7 +85,7 @@ jobs: needs: build steps: - - name: Test + - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: From 504d83af412eef718ba122df8b720ec20e094d15 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 18:58:43 +0200 Subject: [PATCH 04/39] Split test --- .github/workflows/java-gradle-library.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 406512b8f..29fae9bc4 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -88,6 +88,12 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} + + asses-code: + name: Test and asses code quality + runs-on: ubuntu-22.04 + needs: test + steps: - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 @@ -106,7 +112,7 @@ jobs: publish: name: Publish runs-on: ubuntu-22.04 - needs: test + needs: asses-code steps: - name: Publish From 69d4f0354743df2a07f964222228a429bccd486b Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 18:59:56 +0200 Subject: [PATCH 05/39] Split test --- .github/workflows/java-gradle-library.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 29fae9bc4..ecc3f894f 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -79,7 +79,7 @@ jobs: needs: build steps: - - name: Run unit tests + - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: @@ -90,7 +90,7 @@ jobs: working-directory: ${{ inputs.working-directory }} asses-code: - name: Test and asses code quality + name: Asses code quality runs-on: ubuntu-22.04 needs: test steps: From b390fc5a1a886b802c9ba601cd3e4ead08ac920e Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 19:01:29 +0200 Subject: [PATCH 06/39] Split test --- .github/workflows/java-gradle-library.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index ecc3f894f..dc7dc749d 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -74,7 +74,7 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test and asses code quality + name: Test runs-on: ubuntu-22.04 needs: build From 180e9d3f8e145fc9266587d3e1394344743ef933 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 19:11:27 +0200 Subject: [PATCH 07/39] Split test --- .github/workflows/java-gradle-docker.yaml | 11 ++++++++--- .github/workflows/java-gradle-library.yaml | 7 +++---- .github/workflows/java-gradle-plugin.yaml | 11 ++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 5075eb123..a21fc9d18 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -84,10 +84,9 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test and asses code quality + name: Test runs-on: ubuntu-22.04 needs: build - steps: - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test @@ -98,6 +97,12 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} + + assess-code: + name: Asses code quality + runs-on: ubuntu-22.04 + needs: test + steps: - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 @@ -116,7 +121,7 @@ jobs: build-jib: name: Build tarball image runs-on: ubuntu-22.04 - needs: test + needs: assess-code steps: - name: Build tarball image diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index dc7dc749d..7e594b5c6 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -77,9 +77,8 @@ jobs: name: Test runs-on: ubuntu-22.04 needs: build - steps: - - name: Run unit tests + - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 with: @@ -89,7 +88,7 @@ jobs: java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} - asses-code: + assess-code: name: Asses code quality runs-on: ubuntu-22.04 needs: test @@ -112,7 +111,7 @@ jobs: publish: name: Publish runs-on: ubuntu-22.04 - needs: asses-code + needs: assess-code steps: - name: Publish diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 5422efaa7..d58fa3617 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -80,10 +80,9 @@ jobs: working-directory: ${{ inputs.working-directory }} test: - name: Test and asses code quality + name: Test runs-on: ubuntu-22.04 needs: build - steps: - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test @@ -94,6 +93,12 @@ jobs: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} + + assess-code: + name: Asses code quality + runs-on: ubuntu-22.04 + needs: test + steps: - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 @@ -112,7 +117,7 @@ jobs: publish: name: Publish runs-on: ubuntu-22.04 - needs: test + needs: assess-code steps: - name: Publish From 777df37b46a55c94053fe9ca284fe173e8e6e903 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 22 Sep 2023 11:55:18 +0200 Subject: [PATCH 08/39] Group build, test and asses in one workflow --- .github/workflows/README.md | 87 +++++++++++++++-- .github/workflows/java-gradle-base.yaml | 103 +++++++++++++++++++++ .github/workflows/java-gradle-docker.yaml | 42 ++------- .github/workflows/java-gradle-library.yaml | 42 ++------- .github/workflows/java-gradle-plugin.yaml | 42 ++------- 5 files changed, 204 insertions(+), 112 deletions(-) create mode 100644 .github/workflows/java-gradle-base.yaml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 395779a6e..67ca7d409 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -11,6 +11,7 @@ The following workflows can be found here: - [Python Poetry Release](#python-poetry-release) - [Python Poetry Publish PyPI](#python-poetry-publish-pypi) - [Python Poetry Publish Snapshot](#python-poetry-publish-snapshot) +- [Java Gradle Base](#java-gradle-base) - [Java Gradle Docker](#java-gradle-docker) - [Java Gradle Library](#java-gradle-library) - [Java Gradle Plugin](#java-gradle-plugin) @@ -679,6 +680,8 @@ These secrets define the TestPyPI token that allow the GitHub action to release | ---------- | :------: | ---------------------------------------------- | | pypi-token | ✅ | The TestPyPI API token for publishing packages | +ƒ + ### Calling the workflow ```yaml @@ -698,7 +701,7 @@ jobs: pypi-token: ${{ secrets.TEST_PYPI_TOKEN }} ``` -## Java Gradle Docker +## Java Gradle Base This workflow will build, test and publish a Java Gradle project including a tarball image. Additionally, the workflow creates a GitHub Release when running on a tag branch. @@ -714,6 +717,78 @@ This workflow is built from multiple composite actions listed below: - [java-gradle-build](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-build) - [java-gradle-test](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-test) +- [java-gradle-assess-code-quality](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-assess-code-quality) + +### Input Parameters + +| Name | Required | Default Value | Type | Description | +| ------------------ | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| working-directory | ❌ | . | string | Working directory of your Gradle artifacts | +| download-lfs-files | ❌ | "false" | string | Whether the Git checkout action should resolve LFS files or not | + +### Secret Parameters + +For Sonarcloud you need to provide a `sonar-token` and a `sonar-organization` to publish code quality results. In case of Sonatype, the action +requires you to have a `signing-secret-key-ring` (base64 encoded), a `signing-key-id` and a `signing-password` to sign +your build artifacts and additionally an `ossrh-username` and an `ossrh-password` to publish the signed artifacts to +Nexus. + +| Name | Required | Description | +| ----------------------- | :------: | -------------------------------------------------------------- | +| sonar-token | ✅ | Token for Sonarcloud | +| sonar-organization | ✅ | Organization for Sonarcloud | +| signing-secret-key-ring | ✅ | Key ring (base64 encoded) for signing the Sonatype publication | +| signing-key-id | ✅ | Key id for signing the Sonatype publication | +| signing-password | ✅ | Password for signing the Sonatype publication | +| ossrh-username | ✅ | Username for signing into Sonatype repository | +| ossrh-password | ✅ | Password for signing into Sonatype repository | + +### Calling the workflow + +```yaml +name: Call this reusable workflow + +on: + push: + branches: [main] + +jobs: + call-workflow-passing-data: + name: Java Gradle Docker + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@main + with: + java-distribution: "microsoft" # (Optional) Default is microsoft + java-version: "11" # (Optional) Default is 11 + gradle-version: "wrapper" # (Optional) Default is wrapper + gradle-cache: false # (Optional) Default is true + working-directory: "." # (Optional) Default is . + secrets: + sonar-token: ${{ secrets.SONARCLOUD_TOKEN }} + sonar-organization: ${{ secrets.SONARCLOUD_ORGANIZATION }} + signing-secret-key-ring: ${{ secrets.SIGNING_SECRET_KEY_RING }} + signing-key-id: ${{ secrets.SIGNING_KEY_ID }} + signing-password: ${{ secrets.SIGNING_PASSWORD }} +``` + +## Java Gradle Docker + +This workflow will build, test and publish a Java Gradle project including a tarball image. Additionally, +the workflow creates a GitHub Release when running on a tag branch. + +### Prerequisites + +Your Java project needs to be set up with Gradle and either needs to contain a `build.gradle` or a `build.gradle.kts` +file that uses the [Sonar](https://github.com/bakdata/gradle-plugins/tree/master/sonar), [Sonatype](https://github.com/bakdata/gradle-plugins/tree/master/sonatype) and [Jib](https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin) plugins. Moreover, prepare credentials for Sonarcloud, Sonatype, GitHub and Docker. + +### Dependencies + +This workflow is built from multiple composite actions and workflows listed below: + +- [java-gradle-base](https://github.com/bakdata/ci-templates/tree/main/.github/workflows/java-gradle-base.yaml) - [java-gradle-build-jib](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-build-jib) - [java-gradle-publish](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-publish) - [docker-publish](https://github.com/bakdata/ci-templates/tree/main/actions/docker-publish) @@ -799,10 +874,9 @@ file that uses the [Sonar](https://github.com/bakdata/gradle-plugins/tree/master ### Dependencies -This workflow is built from multiple composite actions listed below: +This workflow is built from multiple composite actions and workflows listed below: -- [java-gradle-build](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-build) -- [java-gradle-test](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-test) +- [java-gradle-base](https://github.com/bakdata/ci-templates/tree/main/.github/workflows/java-gradle-base.yaml) - [java-gradle-publish](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-publish) - [java-gradle-release-github](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-release-github) @@ -880,10 +954,9 @@ and Gradle Plugin Portal. ### Dependencies -This workflow is built from multiple composite actions listed below: +This workflow is built from multiple composite actions and workflows listed below: -- [java-gradle-build](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-build) -- [java-gradle-test](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-test) +- [java-gradle-base](https://github.com/bakdata/ci-templates/tree/main/.github/workflows/java-gradle-base.yaml) - [java-gradle-publish](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-publish) - [java-gradle-publish-plugin](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-publish-plugin) - [java-gradle-release-github](https://github.com/bakdata/ci-templates/tree/main/actions/java-gradle-release-github) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml new file mode 100644 index 000000000..22abecaa1 --- /dev/null +++ b/.github/workflows/java-gradle-base.yaml @@ -0,0 +1,103 @@ +name: Java Gradle Base +# Reusable workflow for building testing and assessing code quality + +on: + workflow_call: + inputs: + java-distribution: + description: "Java distribution to be installed. (Default is microsoft)" + required: false + type: string + default: "microsoft" + java-version: + description: "Java version to be installed. (Default is 11)" + required: false + type: string + default: "11" + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + type: string + default: "wrapper" + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + type: boolean + default: true + working-directory: + description: "Working directory of your Gradle artifacts. (Default is .)" + required: false + type: string + default: "." + download-lfs-files: + description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" + required: false + type: string + default: false + secrets: + sonar-token: + description: "Token for Sonarcloud." + required: true + sonar-organization: + description: "Organization for Sonarcloud" + required: true + signing-secret-key-ring: + description: "Key ring (base64 encoded) for signing the Sonatype publication." + required: true + signing-key-id: + description: "Key id for signing the Sonatype publication." + required: true + signing-password: + description: "Password for signing the Sonatype publication." + required: true + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + + steps: + - name: Build + uses: bakdata/ci-templates/actions/java-gradle-build@v1.16.0 + with: + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} + + test: + name: Test + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Run unit tests + uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 + with: + gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + working-directory: ${{ inputs.working-directory }} + + assess-code: + name: Asses code quality + runs-on: ubuntu-22.04 + needs: test + steps: + - name: Assess code quality + uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 + with: + gradle-cache: ${{ inputs.gradle-cache }} + gradle-version: ${{ inputs.gradle-version }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} + working-directory: ${{ inputs.working-directory }} + download-lfs-files: ${{ inputs.download-lfs-files }} diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index a21fc9d18..b7ae36f3e 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -69,59 +69,31 @@ on: required: true jobs: - build: - name: Build + java-gradle-base: + name: Build, Test and Assess code quality runs-on: ubuntu-22.04 steps: - - name: Build - uses: bakdata/ci-templates/actions/java-gradle-build@v1.16.0 + - name: Build, Test & Assess + uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} - - test: - name: Test - runs-on: ubuntu-22.04 - needs: build - steps: - - name: Run unit tests - uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - working-directory: ${{ inputs.working-directory }} - - assess-code: - name: Asses code quality - runs-on: ubuntu-22.04 - needs: test - steps: - - name: Assess code quality - uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} - working-directory: ${{ inputs.working-directory }} build-jib: name: Build tarball image runs-on: ubuntu-22.04 - needs: assess-code + needs: java-gradle-base steps: - name: Build tarball image diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 7e594b5c6..482bd3330 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -59,59 +59,31 @@ on: required: true jobs: - build: - name: Build + java-gradle-base: + name: Build, Test and Assess code quality runs-on: ubuntu-22.04 steps: - - name: Build - uses: bakdata/ci-templates/actions/java-gradle-build@v1.16.0 + - name: Build, Test & Assess + uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} - - test: - name: Test - runs-on: ubuntu-22.04 - needs: build - steps: - - name: Run unit tests - uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - working-directory: ${{ inputs.working-directory }} - - assess-code: - name: Asses code quality - runs-on: ubuntu-22.04 - needs: test - steps: - - name: Assess code quality - uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} - working-directory: ${{ inputs.working-directory }} publish: name: Publish runs-on: ubuntu-22.04 - needs: assess-code + needs: java-gradle-base steps: - name: Publish diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index d58fa3617..25849eec7 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -65,59 +65,31 @@ on: required: true jobs: - build: - name: Build + java-gradle-base: + name: Build, Test and Assess code quality runs-on: ubuntu-22.04 steps: - - name: Build - uses: bakdata/ci-templates/actions/java-gradle-build@v1.16.0 + - name: Build, Test & Assess + uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test + # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} - - test: - name: Test - runs-on: ubuntu-22.04 - needs: build - steps: - - name: Run unit tests - uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - working-directory: ${{ inputs.working-directory }} - - assess-code: - name: Asses code quality - runs-on: ubuntu-22.04 - needs: test - steps: - - name: Assess code quality - uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 - with: - gradle-cache: ${{ inputs.gradle-cache }} - gradle-version: ${{ inputs.gradle-version }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} - working-directory: ${{ inputs.working-directory }} publish: name: Publish runs-on: ubuntu-22.04 - needs: assess-code + needs: java-gradle-base steps: - name: Publish From 7e399871b29296608cae9294b13017d95b386a76 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 22 Sep 2023 12:21:04 +0200 Subject: [PATCH 09/39] Group build, test and asses in one workflow --- .github/workflows/java-gradle-docker.yaml | 4 ++-- .github/workflows/java-gradle-library.yaml | 4 ++-- .github/workflows/java-gradle-plugin.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index b7ae36f3e..03c18526a 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -75,8 +75,8 @@ jobs: steps: - name: Build, Test & Assess - uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 with: java-distribution: ${{ inputs.java-distribution }} diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 482bd3330..66b151026 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -65,8 +65,8 @@ jobs: steps: - name: Build, Test & Assess - uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 with: java-distribution: ${{ inputs.java-distribution }} diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 25849eec7..b8f58fb5f 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -71,8 +71,8 @@ jobs: steps: - name: Build, Test & Assess - uses: bakdata/ci-templates/actions/java-gradle-base@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-base@1.35.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 with: java-distribution: ${{ inputs.java-distribution }} From 27a25d9469aaf0f44dd4b74abb6c112fe9308ae0 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 22 Sep 2023 12:26:05 +0200 Subject: [PATCH 10/39] Group build, test and asses in one workflow --- .github/workflows/java-gradle-docker.yaml | 30 ++++++++++------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 03c18526a..29b4777ec 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -71,24 +71,20 @@ on: jobs: java-gradle-base: name: Build, Test and Assess code quality - runs-on: ubuntu-22.04 - - steps: - - name: Build, Test & Assess - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 - with: - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - working-directory: ${{ inputs.working-directory }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - sonar-organization: ${{ secrets.sonar-organization }} - sonar-token: ${{ secrets.sonar-token }} + with: + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} build-jib: name: Build tarball image From 55c6252d70439a55ea2edb82bfbe528f3094db35 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 11:08:14 +0200 Subject: [PATCH 11/39] Add warning flag --- .github/workflows/java-gradle-base.yaml | 2 +- actions/java-gradle-release/action.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 22abecaa1..568ed9ea4 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -100,4 +100,4 @@ jobs: sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} - download-lfs-files: ${{ inputs.download-lfs-files }} + download-lfs-files: ${{ inputs.download-lfs-files }} \ No newline at end of file diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index a522eeefb..7571706aa 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -87,7 +87,7 @@ runs: working-directory: ${{ inputs.working-directory }} - name: Generate changelog - run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog + run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --warning-mode all --stacktrace --info generateChangelog shell: bash working-directory: ${{ inputs.working-directory }} env: From 9637ba02b59b2b350906886c458fac1a84011074 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 11:55:13 +0200 Subject: [PATCH 12/39] Add warning flag --- .github/workflows/java-gradle-library.yaml | 30 ++++++++++------------ actions/java-gradle-release/action.yaml | 14 +++++----- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 66b151026..c03071523 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -61,24 +61,20 @@ on: jobs: java-gradle-base: name: Build, Test and Assess code quality - runs-on: ubuntu-22.04 - - steps: - - name: Build, Test & Assess - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + with: + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} - with: - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - working-directory: ${{ inputs.working-directory }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - sonar-organization: ${{ secrets.sonar-organization }} - sonar-token: ${{ secrets.sonar-token }} publish: name: Publish diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 7571706aa..1e8e4defc 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -86,13 +86,13 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} - - name: Generate changelog - run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --warning-mode all --stacktrace --info generateChangelog - shell: bash - working-directory: ${{ inputs.working-directory }} - env: - GITHUB_USER: ${{ inputs.github-username }} - GITHUB_TOKEN: ${{ inputs.github-token }} + # - name: Generate changelog + # run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --warning-mode all --stacktrace --info generateChangelog + # shell: bash + # working-directory: ${{ inputs.working-directory }} + # env: + # GITHUB_USER: ${{ inputs.github-username }} + # GITHUB_TOKEN: ${{ inputs.github-token }} - name: Commit and push run: | From d362b58e8d513b53173b379d1e0444c96355d1a5 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 12:01:11 +0200 Subject: [PATCH 13/39] Add warning flag --- .github/workflows/java-gradle-base.yaml | 16 ++++++++-------- .github/workflows/java-gradle-library.yaml | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 568ed9ea4..0e20fde00 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -35,20 +35,20 @@ on: type: string default: false secrets: - sonar-token: - description: "Token for Sonarcloud." + signing-key-id: + description: "Key id for signing the Sonatype publication." required: true - sonar-organization: - description: "Organization for Sonarcloud" + signing-password: + description: "Password for signing the Sonatype publication." required: true signing-secret-key-ring: description: "Key ring (base64 encoded) for signing the Sonatype publication." required: true - signing-key-id: - description: "Key id for signing the Sonatype publication." + sonar-organization: + description: "Organization for Sonarcloud" required: true - signing-password: - description: "Password for signing the Sonatype publication." + sonar-token: + description: "Token for Sonarcloud." required: true jobs: diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index c03071523..22d9e7d1e 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -69,11 +69,13 @@ jobs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} + + secrets: signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} + sonar-organization: ${{ secrets.sonar-organization }} publish: From 5e29def161864a049167d5f8d9b9bf5ccabf37bc Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 12:10:13 +0200 Subject: [PATCH 14/39] Add warning flag --- .github/workflows/java-gradle-library.yaml | 39 +++++++++++----------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 22d9e7d1e..739ed40e4 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -78,31 +78,32 @@ jobs: sonar-organization: ${{ secrets.sonar-organization }} - publish: - name: Publish - runs-on: ubuntu-22.04 - needs: java-gradle-base + # publish: + # name: Publish + # runs-on: ubuntu-22.04 + # needs: java-gradle-base - steps: - - name: Publish - uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 - with: - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} - ossrh-username: ${{ secrets.ossrh-username }} - ossrh-password: ${{ secrets.ossrh-password }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - working-directory: ${{ inputs.working-directory }} + # steps: + # - name: Publish + # uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 + # with: + # signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + # signing-key-id: ${{ secrets.signing-key-id }} + # signing-password: ${{ secrets.signing-password }} + # ossrh-username: ${{ secrets.ossrh-username }} + # ossrh-password: ${{ secrets.ossrh-password }} + # java-distribution: ${{ inputs.java-distribution }} + # java-version: ${{ inputs.java-version }} + # gradle-version: ${{ inputs.gradle-version }} + # gradle-cache: ${{ inputs.gradle-cache }} + # working-directory: ${{ inputs.working-directory }} release: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + # needs: publish + needs: java-gradle-base steps: - name: Release on Github From 9c3920a9095a84c6f9055abbe74d2f381ea3a69b Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 12:35:14 +0200 Subject: [PATCH 15/39] Add publish --- .github/workflows/java-gradle-library.yaml | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 739ed40e4..f85030362 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -78,25 +78,25 @@ jobs: sonar-organization: ${{ secrets.sonar-organization }} - # publish: - # name: Publish - # runs-on: ubuntu-22.04 - # needs: java-gradle-base + publish: + name: Publish + runs-on: ubuntu-22.04 + needs: java-gradle-base - # steps: - # - name: Publish - # uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 - # with: - # signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - # signing-key-id: ${{ secrets.signing-key-id }} - # signing-password: ${{ secrets.signing-password }} - # ossrh-username: ${{ secrets.ossrh-username }} - # ossrh-password: ${{ secrets.ossrh-password }} - # java-distribution: ${{ inputs.java-distribution }} - # java-version: ${{ inputs.java-version }} - # gradle-version: ${{ inputs.gradle-version }} - # gradle-cache: ${{ inputs.gradle-cache }} - # working-directory: ${{ inputs.working-directory }} + steps: + - name: Publish + uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 + with: + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + ossrh-username: ${{ secrets.ossrh-username }} + ossrh-password: ${{ secrets.ossrh-password }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} release: name: Create Github release From 0f6f13206077365033624a657551868e2ab2deb4 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 15:01:05 +0200 Subject: [PATCH 16/39] Clean code --- .github/workflows/README.md | 2 -- .github/workflows/java-gradle-library.yaml | 10 ++++------ actions/java-gradle-release/action.yaml | 20 +++++++++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 67ca7d409..fb60eeb43 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -680,8 +680,6 @@ These secrets define the TestPyPI token that allow the GitHub action to release | ---------- | :------: | ---------------------------------------------- | | pypi-token | ✅ | The TestPyPI API token for publishing packages | -ƒ - ### Calling the workflow ```yaml diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index f85030362..0b6930381 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -59,11 +59,11 @@ on: required: true jobs: - java-gradle-base: + build-and-test: name: Build, Test and Assess code quality uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - with: # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 + with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} gradle-version: ${{ inputs.gradle-version }} @@ -77,11 +77,10 @@ jobs: sonar-token: ${{ secrets.sonar-token }} sonar-organization: ${{ secrets.sonar-organization }} - publish: name: Publish runs-on: ubuntu-22.04 - needs: java-gradle-base + needs: build-and-test steps: - name: Publish @@ -102,8 +101,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - # needs: publish - needs: java-gradle-base + needs: publish steps: - name: Release on Github diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 1e8e4defc..61608f155 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -2,6 +2,10 @@ name: "Release Java artifacts" description: "Release Java Gradle artifacts on Github" inputs: + changelog-file: + description: Path to the changelog file in the GitHub repository + required: false + default: "CHANGELOG.md" release-type: description: "Scope of the release" required: true @@ -86,13 +90,15 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} - # - name: Generate changelog - # run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --warning-mode all --stacktrace --info generateChangelog - # shell: bash - # working-directory: ${{ inputs.working-directory }} - # env: - # GITHUB_USER: ${{ inputs.github-username }} - # GITHUB_TOKEN: ${{ inputs.github-token }} + - name: Create changelog + id: build-changelog + uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release + with: + github-token: ${{ inputs.github-token }} + new-tag: ${{ steps.evaluate-version.outputs.release-version }} + changelog-file: "${{ inputs.changelog-file }}" + fetch-reviewers: "true" + fetch-release-information: "true" - name: Commit and push run: | From 27919dac76edf14c99f25b50c2f027d9a78001ed Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 15:06:48 +0200 Subject: [PATCH 17/39] Clean code --- .github/workflows/java-gradle-plugin.yaml | 34 ++++++++++------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index b8f58fb5f..a18da41ae 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -65,31 +65,25 @@ on: required: true jobs: - java-gradle-base: + build-and-test: name: Build, Test and Assess code quality - runs-on: ubuntu-22.04 - - steps: - - name: Build, Test & Assess - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 - - with: - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - working-directory: ${{ inputs.working-directory }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - sonar-organization: ${{ secrets.sonar-organization }} - sonar-token: ${{ secrets.sonar-token }} + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + with: + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + sonar-organization: ${{ secrets.sonar-organization }} + sonar-token: ${{ secrets.sonar-token }} publish: name: Publish runs-on: ubuntu-22.04 - needs: java-gradle-base + needs: build-and-test steps: - name: Publish From 312bfd2895ae85dad914c2fcc0642064b30793c9 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 15:17:26 +0200 Subject: [PATCH 18/39] Add secrets --- .github/workflows/java-gradle-docker.yaml | 1 + .github/workflows/java-gradle-plugin.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 29b4777ec..7fdfd4e06 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -80,6 +80,7 @@ jobs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} + secrets: signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index a18da41ae..4bd228fd9 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -74,6 +74,7 @@ jobs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} working-directory: ${{ inputs.working-directory }} + secrets: signing-key-id: ${{ secrets.signing-key-id }} signing-password: ${{ secrets.signing-password }} signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} From 301a27622be3e7b23cf1e819ccf8bf354a299a7d Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 15:21:03 +0200 Subject: [PATCH 19/39] Coorecet dependencies --- .github/workflows/java-gradle-plugin.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 4bd228fd9..235489906 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -105,7 +105,7 @@ jobs: name: Publish plugin if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: test + needs: publish steps: - name: Publish plugin @@ -126,7 +126,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + needs: publish-plugin steps: - name: Release on Github From 5bcbd953d0d1ed7f7b2a9eabdc95d2ae8239c4b9 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 15:33:04 +0200 Subject: [PATCH 20/39] Test workflow --- .github/workflows/java-gradle-library.yaml | 39 +++++++++++----------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 0b6930381..732f8a8a9 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -77,31 +77,32 @@ jobs: sonar-token: ${{ secrets.sonar-token }} sonar-organization: ${{ secrets.sonar-organization }} - publish: - name: Publish - runs-on: ubuntu-22.04 - needs: build-and-test + # publish: + # name: Publish + # runs-on: ubuntu-22.04 + # needs: build-and-test - steps: - - name: Publish - uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 - with: - signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - signing-key-id: ${{ secrets.signing-key-id }} - signing-password: ${{ secrets.signing-password }} - ossrh-username: ${{ secrets.ossrh-username }} - ossrh-password: ${{ secrets.ossrh-password }} - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - working-directory: ${{ inputs.working-directory }} + # steps: + # - name: Publish + # uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 + # with: + # signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + # signing-key-id: ${{ secrets.signing-key-id }} + # signing-password: ${{ secrets.signing-password }} + # ossrh-username: ${{ secrets.ossrh-username }} + # ossrh-password: ${{ secrets.ossrh-password }} + # java-distribution: ${{ inputs.java-distribution }} + # java-version: ${{ inputs.java-version }} + # gradle-version: ${{ inputs.gradle-version }} + # gradle-cache: ${{ inputs.gradle-cache }} + # working-directory: ${{ inputs.working-directory }} release: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + # needs: publish + needs: build-and-test steps: - name: Release on Github From 79e00799da13c13e300e4d1203894fca5ef58bf2 Mon Sep 17 00:00:00 2001 From: Michael Kora <80787590+MichaelKora@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:05:28 +0200 Subject: [PATCH 21/39] Update .github/workflows/java-gradle-docker.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yannick Röder <33963579+yannick-roeder@users.noreply.github.com> --- .github/workflows/java-gradle-docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 7fdfd4e06..56c391cbb 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -69,7 +69,7 @@ on: required: true jobs: - java-gradle-base: + build-and-test: name: Build, Test and Assess code quality uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 From 0f0c21bb079840aee35e5f21221e3343c63337bb Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 16:11:03 +0200 Subject: [PATCH 22/39] Clean code --- .github/workflows/java-gradle-docker.yaml | 2 +- .github/workflows/java-gradle-library.yaml | 36 +++++++++++----------- .github/workflows/java-gradle-plugin.yaml | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 56c391cbb..8c7972b73 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -90,7 +90,7 @@ jobs: build-jib: name: Build tarball image runs-on: ubuntu-22.04 - needs: java-gradle-base + needs: build-and-test steps: - name: Build tarball image diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 732f8a8a9..84352771a 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -77,25 +77,25 @@ jobs: sonar-token: ${{ secrets.sonar-token }} sonar-organization: ${{ secrets.sonar-organization }} - # publish: - # name: Publish - # runs-on: ubuntu-22.04 - # needs: build-and-test + publish: + name: Publish + runs-on: ubuntu-22.04 + needs: build-and-test - # steps: - # - name: Publish - # uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 - # with: - # signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} - # signing-key-id: ${{ secrets.signing-key-id }} - # signing-password: ${{ secrets.signing-password }} - # ossrh-username: ${{ secrets.ossrh-username }} - # ossrh-password: ${{ secrets.ossrh-password }} - # java-distribution: ${{ inputs.java-distribution }} - # java-version: ${{ inputs.java-version }} - # gradle-version: ${{ inputs.gradle-version }} - # gradle-cache: ${{ inputs.gradle-cache }} - # working-directory: ${{ inputs.working-directory }} + steps: + - name: Publish + uses: bakdata/ci-templates/actions/java-gradle-publish@v1.16.0 + with: + signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }} + signing-key-id: ${{ secrets.signing-key-id }} + signing-password: ${{ secrets.signing-password }} + ossrh-username: ${{ secrets.ossrh-username }} + ossrh-password: ${{ secrets.ossrh-password }} + java-distribution: ${{ inputs.java-distribution }} + java-version: ${{ inputs.java-version }} + gradle-version: ${{ inputs.gradle-version }} + gradle-cache: ${{ inputs.gradle-cache }} + working-directory: ${{ inputs.working-directory }} release: name: Create Github release diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 235489906..25dd8b0ef 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -105,7 +105,7 @@ jobs: name: Publish plugin if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + needs: build-and-test steps: - name: Publish plugin @@ -126,7 +126,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish-plugin + needs: [publish, publish-plugin] steps: - name: Release on Github From 2f117e26437ebf36f4a8832410190a480c9de4ec Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 29 Sep 2023 10:50:50 +0200 Subject: [PATCH 23/39] Clean code --- .github/workflows/java-gradle-library.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 84352771a..15f7141df 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -101,7 +101,6 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - # needs: publish needs: build-and-test steps: From 9ec24c017c201fa2e3a506cac507b2993a6228e0 Mon Sep 17 00:00:00 2001 From: Michael Kora <80787590+MichaelKora@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:09:10 +0200 Subject: [PATCH 24/39] Update .github/workflows/java-gradle-base.yaml Co-authored-by: Torben Meyer --- .github/workflows/java-gradle-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 0e20fde00..dc5819adf 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -81,7 +81,7 @@ jobs: java-version: ${{ inputs.java-version }} working-directory: ${{ inputs.working-directory }} - assess-code: + assess-code-quality: name: Asses code quality runs-on: ubuntu-22.04 needs: test From 3b2bc4fd5ac47b24d8a5a34b9f6e0c955ac3c7c4 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 10:10:38 +0200 Subject: [PATCH 25/39] Clean code --- .github/workflows/java-gradle-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 0e20fde00..4550eaa0f 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -100,4 +100,4 @@ jobs: sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} - download-lfs-files: ${{ inputs.download-lfs-files }} \ No newline at end of file + download-lfs-files: ${{ inputs.download-lfs-files }} From dc1b69274fe3a3ec900f98d9e678062025528e71 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 10:12:44 +0200 Subject: [PATCH 26/39] Clean code --- .github/workflows/java-gradle-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 6a270c87d..d159f45f9 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -84,7 +84,7 @@ jobs: assess-code-quality: name: Asses code quality runs-on: ubuntu-22.04 - needs: test + needs: build steps: - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test From 5f1411a346cf319b1fa3afc6bc52964697ef0a91 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 10:52:39 +0200 Subject: [PATCH 27/39] Clean code --- .github/workflows/java-gradle-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index d159f45f9..c6f5c0d17 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -90,6 +90,7 @@ jobs: uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 with: + download-lfs-files: ${{ inputs.download-lfs-files }} gradle-cache: ${{ inputs.gradle-cache }} gradle-version: ${{ inputs.gradle-version }} java-distribution: ${{ inputs.java-distribution }} @@ -100,4 +101,3 @@ jobs: sonar-organization: ${{ secrets.sonar-organization }} sonar-token: ${{ secrets.sonar-token }} working-directory: ${{ inputs.working-directory }} - download-lfs-files: ${{ inputs.download-lfs-files }} From 38216bf6eeff72e67ac55b242cd9a19d4312a029 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 13:14:21 +0200 Subject: [PATCH 28/39] Change data type to boolean --- .github/workflows/java-gradle-base.yaml | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index c6f5c0d17..bc4c27995 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -4,6 +4,21 @@ name: Java Gradle Base on: workflow_call: inputs: + download-lfs-files: + description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" + required: false + type: boolean + default: false + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + type: boolean + default: true + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + type: string + default: "wrapper" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -14,26 +29,11 @@ on: required: false type: string default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - type: string - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - type: boolean - default: true working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false type: string default: "." - download-lfs-files: - description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" - required: false - type: string - default: false secrets: signing-key-id: description: "Key id for signing the Sonatype publication." From c21226a993669dc63eca1dcd61cd11c690906958 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 16:40:58 +0200 Subject: [PATCH 29/39] Revert changelog related changes --- actions/java-gradle-release/action.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index a8ed45a1c..bebb00ca7 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -90,15 +90,13 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} - - name: Create changelog - id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release - with: - github-token: ${{ inputs.github-token }} - new-tag: ${{ steps.evaluate-version.outputs.release-version }} - changelog-file: "${{ inputs.changelog-file }}" - fetch-reviewers: "true" - fetch-release-information: "true" + - name: Generate changelog + run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog + shell: bash + working-directory: ${{ inputs.working-directory }} + env: + GITHUB_USER: ${{ inputs.github-username }} + GITHUB_TOKEN: ${{ inputs.github-token }} - name: Commit and push run: | From 76f035b7b138f41d81e266b84a2b6bfb20ea3c1f Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 16:42:56 +0200 Subject: [PATCH 30/39] Revert changelog related changes --- actions/java-gradle-release/action.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index bebb00ca7..76b21e3b1 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -2,10 +2,6 @@ name: "Release Java artifacts" description: "Release Java Gradle artifacts on Github" inputs: - changelog-file: - description: Path to the changelog file in the GitHub repository - required: false - default: "CHANGELOG.md" release-type: description: "Scope of the release" required: true From 5c0b875a0f79e4bb2183b2dd21c1dea35a2b66b6 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 16:51:57 +0200 Subject: [PATCH 31/39] Clean code --- .github/workflows/java-gradle-base.yaml | 4 ++-- .github/workflows/java-gradle-docker.yaml | 3 +-- .github/workflows/java-gradle-library.yaml | 2 +- .github/workflows/java-gradle-plugin.yaml | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index bc4c27995..895eac50a 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -73,7 +73,7 @@ jobs: steps: - name: Run unit tests uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-test@1.35.0 + # uses: bakdata/ci-templates/actions/java-gradle-test@1.36.0 with: gradle-cache: ${{ inputs.gradle-cache }} gradle-version: ${{ inputs.gradle-version }} @@ -88,7 +88,7 @@ jobs: steps: - name: Assess code quality uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.35.0 + # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.36.0 with: download-lfs-files: ${{ inputs.download-lfs-files }} gradle-cache: ${{ inputs.gradle-cache }} diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 8c7972b73..04315d7f3 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -72,8 +72,7 @@ jobs: build-and-test: name: Build, Test and Assess code quality uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 - + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 15f7141df..d9049388e 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -62,7 +62,7 @@ jobs: build-and-test: name: Build, Test and Assess code quality uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.35.0 + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index 25dd8b0ef..a0be718bc 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -68,6 +68,7 @@ jobs: build-and-test: name: Build, Test and Assess code quality uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test + # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} From 1dbcf2067164852b81dd09a19467f97f654df671 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 10:57:46 +0200 Subject: [PATCH 32/39] Run release only if both ppublish were successful --- .github/workflows/java-gradle-docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 04315d7f3..2f1a30bb1 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -138,7 +138,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + needs: [ publish, publish-jib-image] steps: - name: Release on Github From 642dd1f24a35379c78e17d87117fe3ab28af5ab9 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 16:19:47 +0200 Subject: [PATCH 33/39] Update dependency in java gradl lib workflow --- .github/workflows/java-gradle-library.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index d9049388e..80ff15ba1 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -101,7 +101,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: build-and-test + needs: publish steps: - name: Release on Github From 34ee9cb0f8fe04f948b2e815d1675f925456a829 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 16:21:48 +0200 Subject: [PATCH 34/39] Update java gradle base doc --- .github/workflows/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 49eac7460..9b3cdb8ca 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -701,8 +701,7 @@ jobs: ## Java Gradle Base -This workflow will build, test and publish a Java Gradle project including a tarball image. Additionally, -the workflow creates a GitHub Release when running on a tag branch. +This workflow will build, test and publish a Java Gradle project. ### Prerequisites From 766b72c2ee8ea3a0161f395174f1e1e417b76a6d Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 09:59:30 +0200 Subject: [PATCH 35/39] Remove ossrh secret from the java gradle base documentation --- .github/workflows/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 9b3cdb8ca..50c69e808 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -984,8 +984,6 @@ changelog when running on a tag branch. | signing-secret-key-ring | ✅ | Key ring (base64 encoded) for signing the Sonatype publication | | signing-key-id | ✅ | Key id for signing the Sonatype publication | | signing-password | ✅ | Password for signing the Sonatype publication | -| ossrh-username | ✅ | Username for signing into Sonatype repository | -| ossrh-password | ✅ | Password for signing into Sonatype repository | | gradle-publish-key | ✅ | Key for publishing to Gradle Plugin Portal | | gradle-publish-secret | ✅ | Secret for publishing to Gradle Plugin Portal | | github-username | ✅ | GitHub username for requesting changes from API | From 9be1032f964313cff741efc53a5689dbc8aff85f Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 10:01:19 +0200 Subject: [PATCH 36/39] Remove ossrh secret from the java gradle base documentation and sort vars --- .github/workflows/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 50c69e808..11e8b2a49 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -736,13 +736,11 @@ Nexus. | Name | Required | Description | | ----------------------- | :------: | -------------------------------------------------------------- | -| sonar-token | ✅ | Token for Sonarcloud | -| sonar-organization | ✅ | Organization for Sonarcloud | -| signing-secret-key-ring | ✅ | Key ring (base64 encoded) for signing the Sonatype publication | | signing-key-id | ✅ | Key id for signing the Sonatype publication | | signing-password | ✅ | Password for signing the Sonatype publication | -| ossrh-username | ✅ | Username for signing into Sonatype repository | -| ossrh-password | ✅ | Password for signing into Sonatype repository | +| signing-secret-key-ring | ✅ | Key ring (base64 encoded) for signing the Sonatype publication | +| sonar-organization | ✅ | Organization for Sonarcloud | +| sonar-token | ✅ | Token for Sonarcloud | ### Calling the workflow @@ -984,6 +982,8 @@ changelog when running on a tag branch. | signing-secret-key-ring | ✅ | Key ring (base64 encoded) for signing the Sonatype publication | | signing-key-id | ✅ | Key id for signing the Sonatype publication | | signing-password | ✅ | Password for signing the Sonatype publication | +| ossrh-username | ✅ | Username for signing into Sonatype repository | +| ossrh-password | ✅ | Password for signing into Sonatype repository | | gradle-publish-key | ✅ | Key for publishing to Gradle Plugin Portal | | gradle-publish-secret | ✅ | Secret for publishing to Gradle Plugin Portal | | github-username | ✅ | GitHub username for requesting changes from API | From a479fa4a09987197683c90a9806472b986780a8c Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 10:07:20 +0200 Subject: [PATCH 37/39] Tag next release --- .github/workflows/java-gradle-base.yaml | 6 ++---- .github/workflows/java-gradle-docker.yaml | 5 ++--- .github/workflows/java-gradle-library.yaml | 3 +-- .github/workflows/java-gradle-plugin.yaml | 3 +-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/java-gradle-base.yaml b/.github/workflows/java-gradle-base.yaml index 895eac50a..98eae76ad 100644 --- a/.github/workflows/java-gradle-base.yaml +++ b/.github/workflows/java-gradle-base.yaml @@ -72,8 +72,7 @@ jobs: needs: build steps: - name: Run unit tests - uses: bakdata/ci-templates/actions/java-gradle-test@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-test@1.36.0 + uses: bakdata/ci-templates/actions/java-gradle-test@1.39.0 with: gradle-cache: ${{ inputs.gradle-cache }} gradle-version: ${{ inputs.gradle-version }} @@ -87,8 +86,7 @@ jobs: needs: build steps: - name: Assess code quality - uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@feat/split-test - # uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.36.0 + uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.39.0 with: download-lfs-files: ${{ inputs.download-lfs-files }} gradle-cache: ${{ inputs.gradle-cache }} diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 2f1a30bb1..90e816142 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -71,8 +71,7 @@ on: jobs: build-and-test: name: Build, Test and Assess code quality - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.39.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} @@ -138,7 +137,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: [ publish, publish-jib-image] + needs: [publish, publish-jib-image] steps: - name: Release on Github diff --git a/.github/workflows/java-gradle-library.yaml b/.github/workflows/java-gradle-library.yaml index 80ff15ba1..02daba5d1 100644 --- a/.github/workflows/java-gradle-library.yaml +++ b/.github/workflows/java-gradle-library.yaml @@ -61,8 +61,7 @@ on: jobs: build-and-test: name: Build, Test and Assess code quality - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.39.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} diff --git a/.github/workflows/java-gradle-plugin.yaml b/.github/workflows/java-gradle-plugin.yaml index a0be718bc..50363340f 100644 --- a/.github/workflows/java-gradle-plugin.yaml +++ b/.github/workflows/java-gradle-plugin.yaml @@ -67,8 +67,7 @@ on: jobs: build-and-test: name: Build, Test and Assess code quality - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test - # uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.36.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.39.0 with: java-distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} From 0ae7c37f8b74e36858cb1e41a500652dd4f439d5 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 11:33:43 +0200 Subject: [PATCH 38/39] Remove unused vars --- .github/workflows/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 11e8b2a49..4ab825f9d 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -731,8 +731,7 @@ This workflow is built from multiple composite actions listed below: For Sonarcloud you need to provide a `sonar-token` and a `sonar-organization` to publish code quality results. In case of Sonatype, the action requires you to have a `signing-secret-key-ring` (base64 encoded), a `signing-key-id` and a `signing-password` to sign -your build artifacts and additionally an `ossrh-username` and an `ossrh-password` to publish the signed artifacts to -Nexus. +your build artifacts. | Name | Required | Description | | ----------------------- | :------: | -------------------------------------------------------------- | From fe62c5f8fdd04f63dff7ee12cf5925d5c57c453c Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 11:37:46 +0200 Subject: [PATCH 39/39] Merge main and clean code --- .github/workflows/java-gradle-release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/java-gradle-release.yaml b/.github/workflows/java-gradle-release.yaml index d4e7738da..374b3e2a8 100644 --- a/.github/workflows/java-gradle-release.yaml +++ b/.github/workflows/java-gradle-release.yaml @@ -8,7 +8,6 @@ on: description: "Scope of the release (major, minor or patch)." required: true type: string - changelog-file: description: Path to the changelog file in the GitHub repository required: false