Skip to content

Commit

Permalink
Merge branch 'master' of github.com:project-tsurugi/tanzawa
Browse files Browse the repository at this point in the history
  • Loading branch information
hishidama committed Sep 25, 2023
2 parents 56eeec7 + 37caab4 commit 4adc836
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 44 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,15 @@ on: [push, pull_request, workflow_dispatch]

jobs:
Build:
runs-on: [self-hosted, docker]
runs-on: ubuntu-latest
permissions:
checks: write
timeout-minutes: 30
container:
image: ghcr.io/project-tsurugi/oltp-sandbox:ubuntu-22.04
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
volumes:
- ${{ vars.gradle_cache_dir }}:/root/.gradle
defaults:
run:
shell: bash
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
GPR_USER: ${{ github.repository_owner }}
GPR_KEY: ${{ secrets.GHCR_PAT }}

services:
tsurugi:
image: ghcr.io/project-tsurugi/tsurugi:latest
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}

steps:
- name: Setup_Java
Expand Down Expand Up @@ -60,9 +44,8 @@ jobs:

Publish:
uses: ./.github/workflows/ci-publish.yml
if: (contains(github.ref, '/tags/') || contains(github.ref, '/heads/master'))
if: github.repository_owner == 'project-tsurugi' && (contains(github.ref, '/tags/') || contains(github.ref, '/heads/master'))
needs: Build
secrets: inherit
permissions:
contents: write
packages: write
19 changes: 8 additions & 11 deletions .github/workflows/ci-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
name: Tanzawa-CI-Publish

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

jobs:
Publish:
runs-on: [self-hosted, docker]
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
timeout-minutes: 30
container:
image: ghcr.io/project-tsurugi/oltp-sandbox:ubuntu-22.04
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
volumes:
- ${{ vars.gradle_cache_dir }}:/root/.gradle
defaults:
run:
shell: bash
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
GPR_USER: ${{ github.repository_owner }}
GPR_KEY: ${{ secrets.GHCR_PAT }}

steps:
- name: Setup_Java
Expand All @@ -39,6 +30,12 @@ jobs:
- name: Publish
run: |
./gradlew -i tanzawa-core:showTsubakuroManifest clean publish
env:
ST_OSSRH_USER: ${{ secrets.ST_OSSRH_USER }}
ST_OSSRH_PASSWORD: ${{ secrets.ST_OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}

- id: Create_Release
name: Create_Release
Expand Down
15 changes: 5 additions & 10 deletions buildSrc/src/main/groovy/tanzawa.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,16 @@ if (hasProperty('mavenLocal')) {
} else {
repositories {
maven {
url 'https://maven.pkg.github.com/project-tsurugi/*'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
content {
includeGroupByRegex 'com\\.tsurugidb.*'
}
credentials {
username findProperty('gpr.user') ?: System.getenv('GPR_USER')
password findProperty('gpr.key') ?: System.getenv('GPR_KEY')
}
}
}
}

repositories {
mavenCentral {
content {
excludeGroupByRegex 'com\\.tsurugidb.*'
}
}
mavenCentral()
}

configurations.all {
Expand All @@ -38,6 +30,7 @@ configurations.all {

java {
withSourcesJar()
withJavadocJar()
}

dependencies {
Expand Down Expand Up @@ -66,6 +59,8 @@ spotbugsMain {
spotbugsTest.enabled = false
checkstyleTest.enabled = false

javadoc.failOnError = false

jar {
manifest.attributes (
'Build-Timestamp': buildTimestamp,
Expand Down
40 changes: 36 additions & 4 deletions buildSrc/src/main/groovy/tanzawa.libs-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java-library'
id 'java-test-fixtures'
id 'signing'
id 'maven-publish'

id 'tanzawa.java-conventions'
Expand All @@ -9,17 +10,48 @@ plugins {
publishing {
repositories {
maven {
name 'GitHubPackages'
url 'https://maven.pkg.github.com/project-tsurugi/tanzawa'
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 version.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username findProperty('gpr.user') ?: System.getenv('GPR_USER')
password findProperty('gpr.key') ?: System.getenv('GPR_KEY')
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 {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

0 comments on commit 4adc836

Please sign in to comment.