-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from praegus/release-from-github
Added workflow to release plugin to Maven Central
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish package to the Maven Central Repository | ||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
maven-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
- name: Install Java and Maven | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
- name: Unsnapshot version | ||
run: mvn versions:set -DremoveSnapshot --file toolchain-fitnesse-plugin/pom.xml | ||
- name: Release Maven package | ||
uses: samuelmeuli/action-maven-publish@v1 | ||
with: | ||
server_id: staging | ||
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 }} | ||
|
||
update-version: | ||
needs: [ maven-release ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Java and Maven | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
- name: Configure git | ||
run: | | ||
git config --global user.email "johan.roeleveld@praegus.nl" | ||
git config --global user.name "Praegus" | ||
- name: Update version | ||
run: | | ||
mvn -B release:update-versions -DautoVersionSubmodules=true --file toolchain-fitnesse-plugin/pom.xml | ||
git add toolchain-fitnesse-plugin/pom.xml | ||
git commit -m "Update version" | ||
git push origin master |