Skip to content

Commit

Permalink
Create github actions for maven central publish (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhang10 authored Apr 12, 2023
1 parent 2973d0e commit 75a3188
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will build a package using Maven and then publish it to maven central when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Publish to Sonatype

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- name: Import GPG key
run: |
mkdir -p ~/.gnupg
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import
- name: Publish to GitHub Packages Apache Maven
run: ./.lipublish/publish.sh
shell: bash
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSWD: ${{ secrets.GPG_PASSWD }}

0 comments on commit 75a3188

Please sign in to comment.