Skip to content

workflows publish-maven fix #5

workflows publish-maven fix

workflows publish-maven fix #5

name: Publish to Maven Central Alice ktx
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Install GPG
run: sudo apt-get install -y gnupg
- name: Create GPG directory
run: mkdir -p ~/.gnupg
- name: Import GPG key
run: |
echo "${{ secrets.GPG_SECRET_KEY }}" | gpg --dearmor > ~/.gnupg/secring.gpg
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Get absolute path of secring.gpg
id: gpg_path
run: echo "GPG_KEY_RING_PATH=$(realpath ~/.gnupg/secring.gpg)" >> $GITHUB_ENV
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ env.GPG_KEY_RING_PATH }}