Skip to content

Commit

Permalink
ci: add action for publishing and releasing on releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sillydan1 committed Nov 8, 2023
1 parent 6020bcc commit 40083d0
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release-ossrh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Gradle Build and Publish Release to OSSRH

on:
release:
types: [created]

jobs:
build-and-publish-release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3

- name: set up jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}

- name: use gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
gradle-version: current

- name: build
run: gradle build -PsigningKey="${GPG_SIGNING_KEY}" -PsigningPassword="${GPG_SIGNING_PASSWORD}" -PossrhUsername="${OSSRH_USERNAME}" -PossrhPassword="${OSSRH_PASSWORD}"
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

- name: publish
run: gradle publish -PsigningKey="${GPG_SIGNING_KEY}" -PsigningPassword="${GPG_SIGNING_PASSWORD}" -PossrhUsername="${OSSRH_USERNAME}" -PossrhPassword="${OSSRH_PASSWORD}"
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 40083d0

Please sign in to comment.