Skip to content

Publish

Publish #252

Workflow file for this run

name: Publish
on:
workflow_run:
workflows: ["Verify", "Version"]
types: [completed]
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
name: Publish to Nexus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Install gpg
run: sudo apt-get install -y gnupg
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ""
- name: Write maven settings
uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >
[
{
"id": "ossrh",
"username": "${{secrets.OSSRH_USERNAME}}",
"password": "${{secrets.OSSRH_TOKEN}}"
}
]
profiles: >
[
{
"id": "ossrh",
"activation": {
"activeByDefault": true
}
}
]
- name: Publish to Nexus
run: mvn clean deploy -DskipTests -P perform-release