Skip to content

Commit

Permalink
Merge pull request #36 from praegus/release-from-github
Browse files Browse the repository at this point in the history
Added workflow to release plugin to Maven Central
  • Loading branch information
joroelev authored Jan 17, 2023
2 parents 6ffd8b0 + 63717cd commit f1e32d0
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-to-maven-central.yml
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

0 comments on commit f1e32d0

Please sign in to comment.