Skip to content

ci: Publish to Maven Central #51

ci: Publish to Maven Central

ci: Publish to Maven Central #51

Workflow file for this run

name: Build
on:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version-file: '.java-version'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
validate-wrappers: true
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Run build
run: ./gradlew build --scan
- name: Store GPG key
run: echo "${{ secrets.GPG_PK }}" | base64 --decode | gpg --import
- name: Publish to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publish -Psigning.gnupg.keyName=pub@iseki.space