Skip to content

Commit

Permalink
[#] Add Github Actions workflow for publishing artifacts with Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
wool0826 committed Jul 30, 2024
1 parent bbdcd78 commit ddcb4d2
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: "Target tag of publish"
required: true
default: 'default'
type: string
push:
branches:
- feature/cw/add-publish-action

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

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: feature/cw/add-publish-action

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

- 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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "com.navercorp.spring"
version = "3.3.3-SNAPSHOT"
version = "3.3.3"

publishing {
publications {
Expand All @@ -13,8 +13,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 @@ -79,6 +79,11 @@ publishing {
}

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

useInMemoryPgpKeys(signingKey, signingPassword)

sign publishing.publications.mavenJava
}

Expand Down

0 comments on commit ddcb4d2

Please sign in to comment.