Skip to content

Commit

Permalink
Add publish action (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanhyeong authored Nov 22, 2024
1 parent 8e301c9 commit b3dcfb7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish artifacts

on:
workflow_dispatch:
inputs:
tag:
description: "Specify the tag, branch, or commit to target for the publish action"
required: true
default: 'default'
type: string

jobs:
publish:
name: Publish artifacts with Gradle
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Verify source integrity
run: ./gradlew clean build -x check

- name: Publish artifacts
run: ./gradlew publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USER_NAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_USER_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
11 changes: 8 additions & 3 deletions buildSrc/src/main/groovy/eventeria.publish-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group "com.navercorp.eventeria"
version "1.2.2"
version "1.2.2-SNAPSHOT"

tasks.withType(Javadoc).configureEach { enabled = false }

Expand All @@ -20,8 +20,8 @@ publishing {

repositories {
maven {
def ossrhUsername = project.hasProperty("ossrhUsername") ? ossrhUsername : ""
def ossrhPassword = project.hasProperty("ossrhPassword") ? ossrhPassword : ""
def ossrhUsername = System.getenv("OSSRH_USERNAME")
def ossrhPassword = System.getenv("OSSRH_PASSWORD")

credentials {
username ossrhUsername
Expand Down Expand Up @@ -82,6 +82,11 @@ publishing {
}

signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")

useInMemoryPgpKeys(signingKey, signingPassword)

sign publishing.publications.mavenJava
}

Expand Down

0 comments on commit b3dcfb7

Please sign in to comment.