Skip to content

Commit

Permalink
Update github action to ensure we push non-snapshot pom.xml before ta…
Browse files Browse the repository at this point in the history
…gging version
  • Loading branch information
fhoeben committed Mar 31, 2022
1 parent 68c1735 commit 00e1d4b
Showing 1 changed file with 37 additions and 11 deletions.
48 changes: 37 additions & 11 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ on:

jobs:
maven-release:
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Java and Maven
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'

- name: Unsnapshot version
run: mvn versions:set -DremoveSnapshot

- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: release
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.MAVEN_USERNAME }}
nexus_password: ${{ secrets.MAVEN_PASSWORD }}

github-release:
needs: [maven-release]
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
Expand All @@ -33,15 +58,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
exclude_types: other,doc,chore

- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: release
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.MAVEN_USERNAME }}
nexus_password: ${{ secrets.MAVEN_PASSWORD }}

- name: Create Release
id: createRelease
uses: softprops/action-gh-release@v1
Expand All @@ -54,23 +70,33 @@ jobs:
target/hsac-fitnesse-plugin-*.jar
update-version:
needs: [maven-release]
needs: [github-release]
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Java and Maven
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'

- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Pull changes from github-release job
run: |
git pull origin
- name: Update version
run: |
mvn -B release:update-versions -DautoVersionSubmodules=true
- name: Push pom.xml with next -SNAPSHOT version to repository
run: |
git add pom.xml
git commit -m "Update version by GitHub action"
git commit -m "Prepare for next developments"
git push origin master

0 comments on commit 00e1d4b

Please sign in to comment.