Skip to content

Publish final artifacts to Maven Central repository #40

Publish final artifacts to Maven Central repository

Publish final artifacts to Maven Central repository #40

Workflow file for this run

name: Publish final artifacts to Maven Central repository
on:
push:
tags:
- centraldogma-*
env:
LC_ALL: "en_US.UTF-8"
jobs:
publish:
name: Publish final artifacts
if: github.repository == 'line/centraldogma'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: setup-jdk-21
name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: |
./gradlew --no-daemon --stacktrace build -PflakyTests=false
- name: Publish and close repository
run: |
./gradlew --no-daemon --stacktrace --max-workers=1 publish closeAndReleaseStagingRepository
env:
# Should not use '-P' option with 'secrets' that can cause unexpected results
# if secret values contains white spaces or new lines.
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USER_NAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/build/${{ github.ref_name }}.tgz
asset_name: ${{ github.ref_name }}.tgz
tag: ${{ github.ref }}