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 e1b97e8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 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 }}
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ println '+ TARGET REPO: ' + releaseRepoUrl
ext {
pomGroupId = group
pomVersion = version
pomArtifactId = "graphedit.core"
pomArtifactName = "graphedit.core"
pomArtifactId = "core"
pomArtifactName = "core"
jdkCompileVersion = 17
}

Expand Down

0 comments on commit e1b97e8

Please sign in to comment.