Skip to content

Commit

Permalink
Remove build config for publishing Maven remote
Browse files Browse the repository at this point in the history
  • Loading branch information
akirakw committed Dec 19, 2023
1 parent c1eb9bd commit 2c17812
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 101 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
checkstyle_input: '**/build/reports/checkstyle/main.xml'

Publish:
uses: ./.github/workflows/ci-publish.yml
if: github.repository_owner == 'project-tsurugi' && (contains(github.ref, '/tags/') || contains(github.ref, '/heads/master'))
uses: ./.github/workflows/ci-release.yml
if: github.repository_owner == 'project-tsurugi' && (contains(github.ref, '/tags/'))
needs: Build
secrets: inherit
permissions:
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/ci-publish.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tanzawa-CI-Release

on: [workflow_dispatch, workflow_call]
concurrency: ${{ github.workflow }}

jobs:
Publish:
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30
defaults:
run:
shell: bash
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

steps:
- name: Setup_Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Checkout
uses: actions/checkout@v3

- name: Create_Release
if: contains(github.ref, '/tags/')
run: |
cd modules/tgsql
../../gradlew -i distZip
cd -
set -x
gh release create ${TANZAWA_VERSION} modules/tgsql/cli/build/distributions/tgsql.zip --title ${TANZAWA_VERSION} --latest --repo project-tsurugi/tanzawa
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TANZAWA_VERSION: ${{ github.ref_name }}
52 changes: 0 additions & 52 deletions buildSrc/src/main/groovy/tanzawa.libs-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,58 +1,6 @@
plugins {
id 'java-library'
id 'java-test-fixtures'
id 'signing'
id 'maven-publish'

id 'tanzawa.java-conventions'
}

publishing {
repositories {
maven {
name 'OSSRH'
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username findProperty('st.ossrh.user') ?: System.getenv('ST_OSSRH_USER')
password findProperty('st.ossrh.password') ?: System.getenv('ST_OSSRH_PASSWORD')
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'Tanzawa'
description = 'Tsurugi SQL console engine is a core library of Tsurugi SQL console.'
url = 'https://github.com/project-tsurugi/tanzawa'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'project-tsurugi'
}
}
scm {
connection = 'scm:git:https://github.com/project-tsurugi/tanzawa.git'
developerConnection = 'scm:git:https://github.com/project-tsurugi/tanzawa.git'
url = 'https://github.com/project-tsurugi/tanzawa'
}
}
}
}
}

signing {
required { isReleaseVersion && gradle.taskGraph.hasTask(":${project.name}:publishMavenJavaPublicationToOSSRHRepository") }
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

0 comments on commit 2c17812

Please sign in to comment.