diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..4533579a --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle b/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle index ad416dc9..27f3bf71 100644 --- a/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle +++ b/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle @@ -4,7 +4,7 @@ plugins { } group = "com.navercorp.spring" -version = "3.3.3-SNAPSHOT" +version = "3.3.3" publishing { publications { @@ -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 @@ -79,6 +79,11 @@ publishing { } signing { + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + + useInMemoryPgpKeys(signingKey, signingPassword) + sign publishing.publications.mavenJava }