Skip to content

Publish to Maven

Publish to Maven #20

# 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
- name: Publish to Maven Central
run: ./gradlew publish