Skip to content

SNAPSHOT :: Gradle publishing #5

SNAPSHOT :: Gradle publishing

SNAPSHOT :: Gradle publishing #5

name: Gradle Publishing
on:
release:
types: [ created ]
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: startsWith(github.event.head_commit.message, 'SNAPSHOT') || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradlew Permission
run: chmod +x ./gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: Build with Gradle
run: ./gradlew build
- name: Publish to GitHub Packages
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}