Skip to content

Publish package to MavenCentral #1

Publish package to MavenCentral

Publish package to MavenCentral #1

Workflow file for this run

name: Publish package to GitHub Packages
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set version
id: version
run: |
DATE=$(date +'%Y%m%d')
HASH=$(git rev-parse --short HEAD)
echo "VERSION=${DATE}-${HASH}" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish package
run: ./gradlew publish -Pversion=$VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}