Merge pull request #523 from usbharu/owl-release

Owl release
This commit is contained in:
usbharu 2024-08-10 16:34:15 +09:00 committed by GitHub
commit d8d6d053f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 129 additions and 12 deletions

8
.github/monorepo.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"projects": {
"./hideout-activitypub": "hideout-activitypub",
"./hideout-core": "hideout-core",
"./hideout-mastodon": "hideout-mastodon",
"./owl": "owl"
}
}

View File

@ -0,0 +1,78 @@
name: master-publish-package.yaml
on:
pull_request:
branches:
- "master"
- "release-test-master"
jobs:
release-diff-check:
name: Release diff check
runs-on: ubuntu-latest
outputs:
diff: ${{ steps.check-diff.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: fetch git
run: git fetch --depth 1 origin
- name: Check diff
id: check-diff
uses: actions/github-script@v3
with:
result-encoding: 'json'
script: |
const fs = require('fs')
const {execSync} = require('child_process');
const jsonData = JSON.parse(fs.readFileSync('./.github/monorepo.json', 'utf8'));
const baseRef = context.payload.pull_request.base.ref
console.log(baseRef)
var tags = []
for (let [key, value] of Object.entries(jsonData.projects)) {
console.log(execSync("git branch", {encoding: 'utf8'}))
const command = "git diff origin/" + baseRef + " -- HEAD --name-only --relative=" + key + "\n";
const output = execSync(command, {encoding: 'utf8'});
console.log(output)
if (output.trim() === '') {
tags.push(value)
}
}
return tags
- name: show diff
env:
DIFF: ${{ steps.check-diff.outputs.result }}
run: echo "$DIFF"
publish-package:
runs-on: ubuntu-latest
needs: release-diff-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
gradle-home-cache-cleanup: true
- name: Publish OWL Local
if: ${{ github.base_ref == 'release-test-master' && contains( needs.release-diff-check.outputs.diff, 'owl') }}
run: ./owl/gradlew :owl:publishMavenPublicationToMavenLocal
- name: Publish OWL Gitea
if: ${{ github.base_ref == 'master' && contains( needs.release-diff-check.outputs.diff , 'owl')}}
run: ./owl/gradlew :owl:publishMavenPublicationToGiteaRepository

View File

@ -2,6 +2,8 @@ name: PullRequest Merge Check
on:
pull_request:
paths-ignore:
- 'owl/**'
branches:
- "develop"
types:

View File

@ -2,5 +2,3 @@ org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED -XX:TieredStopAtLevel=1 -noverify
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn

View File

@ -12,7 +12,6 @@ plugins {
alias(libs.plugins.kotlin.spring)
alias(libs.plugins.kover)
alias(libs.plugins.license.report)
}
apply {
@ -82,8 +81,8 @@ dependencies {
implementation(libs.bundles.ktor.client)
implementation(libs.bundles.apache.tika)
implementation(libs.bundles.openapi)
implementation(libs.bundles.owl.producer)
implementation(libs.bundles.owl.broker)
// implementation(libs.bundles.owl.producer)
// implementation(libs.bundles.owl.broker)
implementation(libs.bundles.spring.boot.oauth2)
implementation(libs.bundles.spring.boot.data.mongodb)
implementation("org.springframework.boot:spring-boot-starter-actuator")
@ -104,7 +103,7 @@ dependencies {
implementation(libs.flyway.core)
runtimeOnly(libs.flyway.postgresql)
implementation("dev.usbharu:owl-common-serialize-jackson:0.0.1")
// implementation("dev.usbharu:owl-common-serialize-jackson:0.0.1")
implementation(libs.javacv) {
exclude(module = "opencv")

View File

@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.kotlin.jvm)
id("maven-publish")
}
@ -13,9 +14,19 @@ allprojects {
}
}
tasks {
create("publishMavenPublicationToMavenLocal") {
subprojects.forEach { dependsOn("${it.path}:publishMavenPublicationToMavenLocal") }
}
create("publishMavenPublicationToGiteaRepository") {
subprojects.forEach { dependsOn("${it.path}:publishMavenPublicationToGiteaRepository") }
}
}
subprojects {
apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("maven-publish")
}
kotlin {
jvmToolchain(21)
@ -28,10 +39,34 @@ subprojects {
}
tasks.test {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "Gitea"
url = uri("https://git.usbharu.dev/api/packages/usbharu/maven")
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token " + (project.findProperty("gpr.gitea") as String? ?: System.getenv("GITEA"))
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
publications {
register<MavenPublication>("maven") {
groupId = "dev.usbharu"
artifactId = project.name
version = project.version.toString()
from(components["kotlin"])
}
}
}
}

View File

@ -2,6 +2,3 @@ kotlin.code.style=official
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
#ksp.useKSP2=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn

0
owl/gradlew vendored Normal file → Executable file
View File