From 9e9dffce9cfc374cc6fc61ca47bb0a7de6e1d473 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 16 Feb 2024 12:40:41 -0500 Subject: [PATCH] Use Gradle init script for Artifactory in verify-staged-artifacts The JFrog CLI does not resolve artifacts properly: only provided `--repo-resolve` is in use --- .github/workflows/verify-staged-artifacts.yml | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/verify-staged-artifacts.yml b/.github/workflows/verify-staged-artifacts.yml index aaf6ecca3a..2085dbd2c8 100644 --- a/.github/workflows/verify-staged-artifacts.yml +++ b/.github/workflows/verify-staged-artifacts.yml @@ -8,6 +8,13 @@ on: required: true type: string +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 }} + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + jobs: verify-staged-with-spring-integration: runs-on: ubuntu-latest @@ -20,24 +27,27 @@ jobs: show-progress: false ref: 6.2.x - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 17 - cache: 'gradle' - - - uses: jfrog/setup-jfrog-cli@v3 - env: - JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} - - - name: Configure JFrog Cli - run: jf gradlec --repo-resolve libs-release-staging + - name: Set up Gradle + uses: spring-io/spring-gradle-build-action@v2 - - name: Verify Spring Integration Kafka against staged release + - name: Prepare Spring Integration project against Staging run: | - sed -i "1,/springKafkaVersion.*/s/springKafkaVersion.*/springKafkaVersion='${{ inputs.releaseVersion }}'/" build.gradle - jf gradle :spring-integration-kafka:check + printf "allprojects { + repositories { + maven { + url 'https://repo.spring.io/libs-staging-local' + credentials { + username = '$ARTIFACTORY_USERNAME' + password = '$ARTIFACTORY_PASSWORD' + } + } + } + }" > staging-repo-init.gradle + + sed -i "1,/springKafkaVersion.*/s/springKafkaVersion.*/springKafkaVersion='${{ inputs.releaseVersion }}'/" build.gradle + + - name: Verify Spring Integration Kafka module against staged release + run: gradle :spring-integration-kafka:check --init-script staging-repo-init.gradle - name: Capture Test Results if: failure()