Skip to content

Publish to Github packages #8

Publish to Github packages

Publish to Github packages #8

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Publish to Github packages
# Trigger workflow manually
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
- name: Publish to GitHub Packages Apache Maven
run: |
mvn deploy -B \
-Pgithub-packages \
-Pgpg-sign \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_KEY: ${{secrets.GPG_KEY}}
MAVEN_GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}