Publish OntoUML4j to the Maven Central Repository #14
Workflow file for this run
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
name: Publish OntoUML4j to the Maven Central Repository | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Import GPG Key | |
run: | | |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > ~/.gnupg/private-key.asc | |
gpg --batch --import ~/.gnupg/private-key.asc | |
env: | |
GPG_TTY: $(tty) | |
- name: Verify Secret Key Import | |
run: gpg --list-secret-keys --keyid-format LONG | |
- name: Check GPG Version | |
run: gpg --version | |
- name: Configure Maven settings.xml | |
run: | | |
cat << EOF > ~/.m2/settings.xml | |
<settings> | |
<servers> | |
<server> | |
<id>ossrh</id> | |
<username>${{ secrets.MAVEN_USERNAME }}</username> | |
<password>${{ secrets.MAVEN_PASSWORD }}</password> | |
</server> | |
</servers> | |
</settings> | |
EOF | |
- name: Publish to Maven Central | |
run: | | |
mvn -B -DskipTests -Dgpg.passphrase="${{ secrets.GPG_PASS }}" release:clean release:prepare release:perform -Possrh | |
env: | |
GPG_TTY: $(tty) |