From 4de65a31590d062df0ca078a0f81e14ae4fd7da3 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Mon, 5 Jun 2023 09:59:05 +0100 Subject: [PATCH] Upgrade jfrog 2.39.1 in release workflows --- .github/workflows/central-sync-create.yml | 58 +++++++++++++++++++++++ .github/workflows/release-ga.yml | 34 ++++++------- .github/workflows/release-milestone.yml | 26 +++++----- 3 files changed, 88 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/central-sync-create.yml diff --git a/.github/workflows/central-sync-create.yml b/.github/workflows/central-sync-create.yml new file mode 100644 index 00000000..e9bcd5bb --- /dev/null +++ b/.github/workflows/central-sync-create.yml @@ -0,0 +1,58 @@ +name: Central Sync Create + +on: + workflow_dispatch: + inputs: + buildName: + description: "Artifactory build name" + required: true + buildNumber: + description: "Artifactory build number" + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + + # to get spec file in .github + - uses: actions/checkout@v2 + + # Setup jfrog cli + - uses: jfrog/setup-jfrog-cli@v3 + with: + version: 2.39.1 + env: + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + + # Extract build id from input + - name: Extract Build Id + run: | + echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV + + # Download released files + - name: Download Release Files + run: | + jf rt download \ + --spec .github/release-files-spec.json \ + --spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER" + + # Create checksums, signatures and create staging repo on central and upload + - uses: jvalkeal/nexus-sync@v0 + id: nexus + with: + url: ${{ secrets.OSSRH_URL }} + username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} + password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} + staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }} + create: true + upload: true + generate-checksums: true + pgp-sign: true + pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }} + pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + + # Print staging repo id + - name: Print Staging Repo Id + run: echo ${{ steps.nexus.outputs.staged-repository-id }} diff --git a/.github/workflows/release-ga.yml b/.github/workflows/release-ga.yml index 4f275c30..788be498 100644 --- a/.github/workflows/release-ga.yml +++ b/.github/workflows/release-ga.yml @@ -22,15 +22,15 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 1.8 - - uses: jfrog/setup-jfrog-cli@v1 + - uses: jfrog/setup-jfrog-cli@v3 with: - version: 1.50.0 + version: 2.39.1 env: - JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} # prepare env for cli to get a staging build working - name: Configure JFrog Cli run: | - jfrog rt gradlec \ + jf gradlec \ --use-wrapper \ --deploy-ivy-desc=false \ --server-id-resolve=repo.spring.io \ @@ -43,15 +43,15 @@ jobs: # version to get used with tagging - name: Configure Release Version run: | - jfrog rt gradle releaseVersion + jf gradle releaseVersion echo PROJECT_VERSION=$(jfrog rt gradle "properties -q" | grep "version:" | awk '{print $2}') >> $GITHUB_ENV # 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. - name: Build and Publish run: | - jfrog rt gradle clean build artifactoryPublish - jfrog rt build-publish + jf gradle clean build artifactoryPublish + jf rt build-publish # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4 @@ -75,15 +75,15 @@ jobs: steps: # need repo to push release branch and a tag - uses: actions/checkout@v2 - - uses: jfrog/setup-jfrog-cli@v1 + - uses: jfrog/setup-jfrog-cli@v3 with: - version: 1.50.0 + version: 2.39.1 env: - JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} # prepare env for cli to promote - name: Configure JFrog Cli run: | - jfrog rt gradlec \ + jf gradlec \ --use-wrapper \ --deploy-ivy-desc=false \ --server-id-resolve=repo.spring.io \ @@ -95,11 +95,11 @@ jobs: # promoting build from staging repo into release - name: Promote Build run: | - jfrog rt build-promote libs-release-local + jf rt build-promote libs-release-local # we've promoted so change repo to next dev version - name: Switch to Next Dev Version run: | - jfrog rt gradle nextVersion + jf gradle nextVersion - uses: jvalkeal/build-zoo-handler@v0.0.4 with: commit-changes-branch: 3.2.x @@ -166,11 +166,11 @@ jobs: steps: # need repo for spec file - uses: actions/checkout@v2 - - uses: jfrog/setup-jfrog-cli@v1 + - uses: jfrog/setup-jfrog-cli@v3 with: - version: 1.50.0 + version: 2.39.1 env: - JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} # prepare env for cli do download released files - name: Configure JFrog Cli run: | @@ -182,7 +182,7 @@ jobs: # which we don't want in central. - name: Download Release Files run: | - jfrog rt download \ + jf rt download \ --spec .github/release-files-spec.json \ --spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER" # last step, sync to central. diff --git a/.github/workflows/release-milestone.yml b/.github/workflows/release-milestone.yml index 4e8bf73f..1fc5dbec 100644 --- a/.github/workflows/release-milestone.yml +++ b/.github/workflows/release-milestone.yml @@ -26,15 +26,15 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 1.8 - - uses: jfrog/setup-jfrog-cli@v1 + - uses: jfrog/setup-jfrog-cli@v3 with: - version: 1.50.0 + version: 2.39.1 env: - JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} # prepare env for cli to get a staging build working - name: Configure JFrog Cli run: | - jfrog rt gradlec \ + jf gradlec \ --use-wrapper \ --deploy-ivy-desc=false \ --server-id-resolve=repo.spring.io \ @@ -47,15 +47,15 @@ jobs: # version to get used with tagging - name: Configure Milestone Version run: | - jfrog rt gradle milestoneVersion -PstatemachineMilestone=${{ github.event.inputs.milestone }} - echo PROJECT_VERSION=$(jfrog rt gradle "properties -q" | grep "version:" | awk '{print $2}') >> $GITHUB_ENV + jf gradle milestoneVersion -PstatemachineMilestone=${{ github.event.inputs.milestone }} + echo PROJECT_VERSION=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}') >> $GITHUB_ENV # 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. - name: Build and Publish run: | - jfrog rt gradle clean build artifactoryPublish - jfrog rt build-publish + jf gradle clean build artifactoryPublish + jf rt build-publish # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4 @@ -79,15 +79,15 @@ jobs: steps: # need repo to push release branch and a tag - uses: actions/checkout@v2 - - uses: jfrog/setup-jfrog-cli@v1 + - uses: jfrog/setup-jfrog-cli@v3 with: - version: 1.50.0 + version: 2.39.1 env: - JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} # prepare env for cli to promote - name: Configure JFrog Cli run: | - jfrog rt gradlec \ + jf gradlec \ --use-wrapper \ --deploy-ivy-desc=false \ --server-id-resolve=repo.spring.io \ @@ -99,7 +99,7 @@ jobs: # promoting build from staging repo into release - name: Promote Build run: | - jfrog rt build-promote libs-milestone-local + jf rt build-promote libs-milestone-local ghrelease: runs-on: ubuntu-latest