-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github action to ensure we push non-snapshot pom.xml before ta…
…gging version
- Loading branch information
Showing
1 changed file
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 |