From 087a3383dd45375296540243d16a2d41402a5165 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 1 Mar 2024 12:07:08 -0500 Subject: [PATCH] Rework verify-staged-artifacts to use sample (#38) --- .github/workflows/verify-staged-artifacts.yml | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/verify-staged-artifacts.yml b/.github/workflows/verify-staged-artifacts.yml index ba984f4b..1839f0bb 100644 --- a/.github/workflows/verify-staged-artifacts.yml +++ b/.github/workflows/verify-staged-artifacts.yml @@ -8,21 +8,42 @@ on: required: true type: string +env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + jobs: - verify-staged-with-jfrog: + verify-staged-with-sample: runs-on: ubuntu-latest steps: - - uses: jfrog/setup-jfrog-cli@v3 - env: - JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - name: Checkout Sample Directory + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + sparse-checkout: 'samples/time-spel-log' + sparse-checkout-cone-mode: false + show-progress: false - - name: Download Artifact from Staging Repo + - name: Set up Gradle + uses: spring-io/spring-gradle-build-action@v2 + + - name: Prepare Sample project against Staging run: | - fileToDownload=org/springframework/cloud/fn/spring-mail-supplier/${{ inputs.releaseVersion }}/spring-mail-supplier-${{ inputs.releaseVersion }}.jar - jfrog rt download libs-staging-local/$fileToDownload - if [ ! -f $fileToDownload ] - then - echo "::error title=No staged artifact::No spring-mail-supplier-${{ inputs.releaseVersion }}.jar in staging repository" - exit 1 - fi \ No newline at end of file + cd samples/time-spel-log + 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,/springFunctionsCatalogVersion.*/s/springFunctionsCatalogVersion.*/springFunctionsCatalogVersion='${{ inputs.releaseVersion }}'/" build.gradle + + - name: Verify time-spel-log sample against staged release + run: gradle check --init-script staging-repo-init.gradle