Skip to content

Commit

Permalink
Fix java release pipeline (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: sauce-visual-bot <[email protected]>
Co-authored-by: Félix P. <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent 6fd7f94 commit 45796fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
git config --global user.email "[email protected]"
- 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 }}
Expand All @@ -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
2 changes: 1 addition & 1 deletion visual-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.saucelabs.visual</groupId>
<artifactId>java-client</artifactId>
<version>0.9.0</version>
<version>0.8.0</version>
<name>visual-java-client</name>
<description>Java library to interact with Sauce Visual</description>

Expand Down

0 comments on commit 45796fc

Please sign in to comment.