Publish to Maven #22
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
# This workflow will build a package using Gradle 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#Publishing-using-gradle | |
name: Publish to Maven | |
on: | |
workflow_dispatch: | |
# TODO: Temporary | |
# release: | |
# types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Execute Gradle build | |
run: ./gradlew build | |
env: | |
STADIA_API_KEY: ${{ secrets.STADIA_API_KEY }} | |
- name: Stage the package | |
run: ./gradlew publish | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Publish to Maven Central | |
run: ./gradlew publish | |
env: | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} |