From fc5fc7f5c3ff641a3c364396dfd071e4ddf9a88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 12 Jul 2024 09:11:41 +0200 Subject: [PATCH] Harmonize GitHub Actions structure This commit harmonizes the order of elements, in particular the settings of the deploy step. It also adds the ability to build against a different distribution than liberica. Closes gh-41457 --- .github/actions/build/action.yml | 9 +++++++-- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 14 +++++++------- .github/workflows/trigger-docs-build.yml | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index c01dc1c34c..6328d227e4 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -5,13 +5,17 @@ inputs: required: false default: '17' description: 'The Java version to compile and test with' + java-distribution: + required: false + default: 'liberica' + description: 'The Java distribution to use for the build' java-toolchain: required: false - default: false + default: 'false' description: 'Whether a Java toolchain should be used' publish: required: false - default: false + default: 'false' description: 'Whether to publish artifacts ready for deployment to Artifactory' develocity-access-key: required: false @@ -31,6 +35,7 @@ runs: with: develocity-access-key: ${{ inputs.develocity-access-key }} java-version: ${{ inputs.java-version }} + java-distribution: ${{ inputs.java-distribution }} java-toolchain: ${{ inputs.java-toolchain }} - name: Build id: build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d814c2c0a5..1e82eda755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: uses: ./.github/actions/build with: java-version: ${{ matrix.java.version }} + java-distribution: ${{ matrix.java.distribution || 'liberica' }} java-toolchain: ${{ matrix.java.toolchain }} develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Send Notification diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0de937f68b..1a62ab82b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} jobs: build-and-stage-release: - if: ${{ github.repository == 'spring-projects/spring-boot' }} name: Build and Stage Release runs-on: ubuntu-latest + if: ${{ github.repository == 'spring-projects/spring-boot' }} steps: - name: Check Out Code uses: actions/checkout@v4 @@ -22,14 +22,14 @@ jobs: - name: Stage Release uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1 with: - build-name: ${{ format('spring-boot-{0}', steps.build-and-publish.outputs.version)}} - folder: 'deployment-repository' - password: ${{ secrets.ARTIFACTORY_PASSWORD }} - repository: 'libs-staging-local' - signing-key: ${{ secrets.GPG_PRIVATE_KEY }} - signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} uri: 'https://repo.spring.io' username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + build-name: ${{ format('spring-boot-{0}', steps.build-and-publish.outputs.version)}} + repository: 'libs-staging-local' + folder: 'deployment-repository' + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} outputs: version: ${{ steps.build-and-publish.outputs.version }} verify: diff --git a/.github/workflows/trigger-docs-build.yml b/.github/workflows/trigger-docs-build.yml index ed02318eff..520e126de5 100644 --- a/.github/workflows/trigger-docs-build.yml +++ b/.github/workflows/trigger-docs-build.yml @@ -8,8 +8,8 @@ permissions: jobs: trigger-docs-build: name: Trigger Docs Build - if: github.repository_owner == 'spring-projects' runs-on: ubuntu-latest + if: github.repository_owner == 'spring-projects' steps: - name: Check Out uses: actions/checkout@v4