From 33d68e787856ea868e189cd0cc71ae350ad672da Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Thu, 27 Jul 2023 16:28:24 -0500 Subject: [PATCH] Update workflows with Gradle Enterprise credentials Only workflows that do not build PRs have been configured with credentials. --- .github/workflows/ci-boot.yml | 4 ++++ .github/workflows/ci.yml | 9 ++++++++- .github/workflows/release-ga.yml | 12 ++++++++++++ .github/workflows/release-milestone.yml | 8 ++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-boot.yml b/.github/workflows/ci-boot.yml index a5cf90ee..f2ee724e 100644 --- a/.github/workflows/ci-boot.yml +++ b/.github/workflows/ci-boot.yml @@ -23,6 +23,10 @@ jobs: java-version: ${{ matrix.java }} - name: Build boot ${{ matrix.boot }} java ${{ matrix.java }} run: ./gradlew clean build -PspringBootVersion=${{ matrix.boot }} + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Tar Build Logs if: ${{ failure() }} run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08d05268..a88d9085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,10 @@ jobs: java-version: ${{ matrix.java }} - name: Build with Gradle run: ./gradlew clean build + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Tar Build Logs if: ${{ failure() }} run: | @@ -79,7 +83,10 @@ jobs: - name: Build and Publish Snapshot run: | jf gradle clean build -x test artifactoryPublish - + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # publish build info so that we can see it in artifactory "builds" - name: Publish Build Info run: | diff --git a/.github/workflows/release-ga.yml b/.github/workflows/release-ga.yml index ffea00b2..c58ee5a3 100644 --- a/.github/workflows/release-ga.yml +++ b/.github/workflows/release-ga.yml @@ -45,6 +45,10 @@ jobs: run: | jf gradle releaseVersion echo PROJECT_VERSION=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}') >> $GITHUB_ENV + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # build and publish to staging repo. # we've allready tested with snapshots so no need to test # with a release build as we are not a release train. @@ -52,6 +56,10 @@ jobs: run: | jf gradle clean build artifactoryPublish jf rt build-publish + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4 @@ -100,6 +108,10 @@ jobs: - name: Switch to Next Dev Version run: | jf gradle nextVersion + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - uses: jvalkeal/build-zoo-handler@v0.0.4 with: commit-changes-branch: main diff --git a/.github/workflows/release-milestone.yml b/.github/workflows/release-milestone.yml index 92f83f91..4b5b360a 100644 --- a/.github/workflows/release-milestone.yml +++ b/.github/workflows/release-milestone.yml @@ -49,6 +49,10 @@ jobs: run: | jf gradle milestoneVersion -PstatemachineMilestone=${{ github.event.inputs.milestone }} echo PROJECT_VERSION=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}') >> $GITHUB_ENV + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # build and publish to staging repo. # we've allready tested with snapshots so no need to test # with a release build as we are not a release train. @@ -56,6 +60,10 @@ jobs: run: | jf gradle clean build artifactoryPublish jf rt build-publish + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4