From 45796fce4c485aa64105d0bd8295ca14ea8630d4 Mon Sep 17 00:00:00 2001 From: Kerem Date: Mon, 8 Jul 2024 10:54:47 +0000 Subject: [PATCH] Fix java release pipeline (#91) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: sauce-visual-bot Co-authored-by: FĂ©lix P. --- .github/workflows/java-release.yml | 33 +++++++++++++++++------------- visual-java/pom.xml | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/java-release.yml b/.github/workflows/java-release.yml index 70bf5f5d..cc13c5b7 100644 --- a/.github/workflows/java-release.yml +++ b/.github/workflows/java-release.yml @@ -30,30 +30,23 @@ jobs: server-id: ossrh server-username: MVN_CENTRAL_USERNAME server-password: MVN_CENTRAL_PASSWORD - + - name: Setup Git if: ${{ steps.prep.outputs.tag_name == '' }} run: | git config --global user.name "sauce-visual-bot" - git config --global user.email "visual@saucelabs.com" + git config --global user.email "visual@saucelabs.com" - - name: upgrade & push version + - name: Upgrade & Build new version id: upgrade run: | current_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) new_version=$(./scripts/bump_version.sh -c $current_version -r ${{ github.event.inputs.releaseType }}) - mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$new_version - tag_name="java-$new_version" - git add ./pom.xml - git commit -m "[release] $tag_name" - git tag $tag_name - git push - git push origin $tag_name - + mvn -q versions:set -DgenerateBackupPoms=false -DnewVersion=$new_version + echo "version=$new_version" >> "$GITHUB_OUTPUT" - echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT" - - name: Import GPG signing key + - name: Sign and upload to Maven Central uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{ secrets.MVN_CENTRAL_GPG_PRIVATE_KEY }} @@ -67,10 +60,22 @@ jobs: MVN_CENTRAL_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME }} MVN_CENTRAL_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }} + - name: Push new version to Git + id: push_to_git + run: | + tag_name="java-${{ steps.upgrade.outputs.version }}" + git add ./pom.xml + git commit -m "[release] $tag_name" + git tag $tag_name + git push + git push origin $tag_name + + echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT" + - name: Github Release uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true - tag_name: ${{ steps.upgrade.outputs.tag_name }} + tag_name: ${{ steps.push_to_git.outputs.tag_name }} files: visual-java/target/java-client-${{ steps.upgrade.outputs.version }}.jar generate_release_notes: true diff --git a/visual-java/pom.xml b/visual-java/pom.xml index 1de6876b..bf53d058 100644 --- a/visual-java/pom.xml +++ b/visual-java/pom.xml @@ -6,7 +6,7 @@ com.saucelabs.visual java-client - 0.9.0 + 0.8.0 visual-java-client Java library to interact with Sauce Visual