Skip to content

chore: setup publication to gradle-plugin registry #19

chore: setup publication to gradle-plugin registry

chore: setup publication to gradle-plugin registry #19

Workflow file for this run

name: build
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
env:
GRADLE_OPTS: "-Dorg.gradle.workers.max=2 -Dorg.gradle.console=plain"
jobs:
# Verifies all tests pass
verify:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: gradle
- uses: taiki-e/install-action@v2
with:
tool: just@1
- run: just verify
# Prepare a release PR or release
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
released: ${{ steps.release.outputs.release_created }}
steps:
- id: release
uses: googleapis/release-please-action@v4
with:
release-type: simple
# Publish the artifacts (only if `verify` passed, and `release` created release)
publish:
needs: [ verify, release ]
if: needs.verify.result == 'success' && needs.release.outputs.released
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: gradle
- uses: taiki-e/install-action@v2
with:
tool: just@1
- name: Setup publication key
run: echo "${{ secrets.GRADLE_PUBLISH_CONFIG }}" > ~/.gradle/gradle.properties
- run: just publish