Skip to content

Commit 216e1a3

Browse files
authored
CI Test
CI Test
2 parents 83f21b7 + 01b4ea8 commit 216e1a3

5 files changed

Lines changed: 215 additions & 18 deletions

File tree

.github/workflows/ci-develop.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
11
name: CI for PR to Develop
22

33
on:
4+
push:
5+
branches: [ develop ]
46
pull_request:
5-
branches:
6-
- develop
7+
branches: [ develop ]
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
java-version: [8, 11, 17, 21, 24]
1116

1217
steps:
1318
- name: Checkout code
1419
uses: actions/checkout@v4
1520

16-
- name: Set up JDK 24
21+
- name: Set up JDK ${{ matrix.java-version }}
1722
uses: actions/setup-java@v4
1823
with:
19-
java-version: '24'
24+
java-version: ${{ matrix.java-version }}
2025
distribution: 'temurin'
2126

27+
- name: Cache Gradle packages
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
key: ${{ runner.os }}-gradle-develop-jdk${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
34+
restore-keys: |
35+
${{ runner.os }}-gradle-develop-jdk${{ matrix.java-version }}-
36+
${{ runner.os }}-gradle-develop-
37+
2238
- name: Setup Gradle
2339
uses: gradle/gradle-build-action@v2
2440

.github/workflows/release-jitpack.yml

Lines changed: 103 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,137 @@
1-
name: Release to JitPack
1+
name: JitPack Release
22

33
permissions:
44
contents: write
55

66
on:
77
push:
8-
branches:
9-
- main
8+
branches: [ main ]
109

1110
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
java-version: [8, 11, 17, 21, 24]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up JDK ${{ matrix.java-version }}
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ matrix.java-version }}
25+
distribution: 'temurin'
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Cache Gradle packages
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: ${{ runner.os }}-gradle-release-jdk${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-release-jdk${{ matrix.java-version }}-
39+
${{ runner.os }}-gradle-release-
40+
41+
- name: Run tests
42+
run: ./gradlew test
43+
44+
- name: Build with Gradle
45+
run: ./gradlew build
46+
47+
- name: Test JitPack publish
48+
run: ./gradlew publishToMavenLocal
49+
50+
- name: Upload build artifacts
51+
uses: actions/upload-artifact@v4
52+
if: matrix.java-version == 8
53+
with:
54+
name: jar-artifacts
55+
path: |
56+
*/build/libs/*.jar
57+
!*/build/libs/*-sources.jar
58+
!*/build/libs/*-javadoc.jar
59+
60+
jitpack-compatibility:
61+
runs-on: ubuntu-latest
62+
needs: test
63+
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up JDK 8
68+
uses: actions/setup-java@v4
69+
with:
70+
java-version: 8
71+
distribution: 'temurin'
72+
73+
- name: Cache Gradle packages
74+
uses: actions/cache@v4
75+
with:
76+
path: |
77+
~/.gradle/caches
78+
~/.gradle/wrapper
79+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
80+
restore-keys: |
81+
${{ runner.os }}-gradle-
82+
83+
- name: Test JitPack build simulation
84+
run: |
85+
chmod +x gradlew
86+
./gradlew clean
87+
./gradlew publishToMavenLocal
88+
echo "JitPack compatibility verified"
89+
1290
release:
1391
runs-on: ubuntu-latest
92+
needs: [test, jitpack-compatibility]
93+
# 보안: 배포 토큰 있을 때만 배포
94+
if: secrets.DEPLOY_TOKEN != ''
1495
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
1697

1798
steps:
1899
- name: Checkout repository
19100
uses: actions/checkout@v4
20101
with:
21102
fetch-depth: 0
22103

23-
- name: Set up JDK 24
104+
- name: Set up JDK 8
24105
uses: actions/setup-java@v4
25106
with:
26-
java-version: '24'
107+
java-version: '8'
27108
distribution: 'temurin'
28109

110+
- name: Cache Gradle packages
111+
uses: actions/cache@v4
112+
with:
113+
path: |
114+
~/.gradle/caches
115+
~/.gradle/wrapper
116+
key: ${{ runner.os }}-gradle-release-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
117+
restore-keys: |
118+
${{ runner.os }}-gradle-jdk8-
119+
${{ runner.os }}-gradle-
120+
29121
- name: Setup Gradle
30122
uses: gradle/gradle-build-action@v2
31123

32124
- name: Make gradlew executable
33125
run: chmod +x ./gradlew
34126

35-
- name: Build with Gradle
127+
- name: Final build for release
36128
run: ./gradlew build
37129

38130
- name: Determine PR title for tag
39131
id: find_pr
40132
uses: actions/github-script@v7
41133
with:
42-
github-token: ${{ secrets.GITHUB_TOKEN }}
134+
github-token: ${{ secrets.DEPLOY_TOKEN }}
43135
script: |
44136
const { data: pulls } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
45137
owner: context.repo.owner,
@@ -53,7 +145,7 @@ jobs:
53145
return;
54146
}
55147
const prTitle = pulls[0].title.trim();
56-
// PR 제목을 태그로 사용하되, 특수문자 제거
148+
57149
const tag = prTitle.replace(/[^a-zA-Z0-9.-]/g, '-').replace(/-+/g, '-');
58150
core.setOutput("tag", tag);
59151

@@ -69,7 +161,7 @@ jobs:
69161
- name: Create GitHub Release
70162
uses: actions/create-release@v1
71163
with:
72-
github_token: ${{ secrets.GITHUB_TOKEN }}
164+
github_token: ${{ secrets.DEPLOY_TOKEN }}
73165
tag_name: ${{ steps.find_pr.outputs.tag }}
74166
release_name: "${{ steps.find_pr.outputs.tag }}"
75167
body: |
@@ -82,7 +174,7 @@ jobs:
82174
}
83175
84176
dependencies {
85-
implementation 'com.github.eulji:commit-chronicle:${{ steps.find_pr.outputs.tag }}'
177+
implementation 'com.github.hj4645:commit-chronicle:${{ steps.find_pr.outputs.tag }}'
86178
}
87179
```
88180
draft: false

cli/build.gradle.kts

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
kotlin("jvm")
33
id("com.github.johnrengelman.shadow") version "8.1.1"
44
application
5+
`maven-publish`
56
}
67

78
dependencies {
@@ -16,12 +17,17 @@ dependencies {
1617

1718
tasks {
1819
shadowJar {
19-
archiveBaseName.set("commitchronicle-cli")
20+
archiveBaseName.set("commitchronicle")
2021
archiveVersion.set("0.1.0")
21-
archiveClassifier.set("all")
22+
archiveClassifier.set("")
2223
manifest {
2324
attributes["Main-Class"] = "com.commitchronicle.cli.MainKt"
2425
}
26+
mergeServiceFiles()
27+
}
28+
29+
build {
30+
dependsOn(shadowJar)
2531
}
2632
}
2733

@@ -44,3 +50,70 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach
4450
application {
4551
mainClass.set("com.commitchronicle.cli.MainKt")
4652
}
53+
54+
// Publishing configuration for JitPack
55+
publishing {
56+
publications {
57+
create<MavenPublication>("maven") {
58+
artifact(tasks.shadowJar)
59+
60+
artifacts.removeAll { it.classifier == null }
61+
artifact(tasks.shadowJar) {
62+
classifier = null
63+
}
64+
65+
groupId = "com.github.hj4645"
66+
artifactId = "commit-chronicle"
67+
version = "0.1.0"
68+
69+
pom {
70+
name.set("Commit Chronicle")
71+
description.set("🚀 AI-powered Git commit analysis and summarization tool with GitHub template support. Generate PR drafts, changelogs, and commit summaries using OpenAI, Claude, Gemini, and more.")
72+
url.set("https://github.com/hj4645/commit-chronicle")
73+
74+
properties.set(mapOf(
75+
"maven.compiler.source" to "8",
76+
"maven.compiler.target" to "8",
77+
"project.build.sourceEncoding" to "UTF-8",
78+
"kotlin.version" to "1.8.0"
79+
))
80+
81+
licenses {
82+
license {
83+
name.set("MIT License")
84+
url.set("https://opensource.org/licenses/MIT")
85+
distribution.set("repo")
86+
}
87+
}
88+
89+
developers {
90+
developer {
91+
id.set("hj4645")
92+
name.set("HJPark")
93+
email.set("hjpark4645@gmail.com")
94+
url.set("https://github.com/hj4645")
95+
roles.set(listOf("Developer", "Maintainer"))
96+
timezone.set("Asia/Seoul")
97+
}
98+
}
99+
100+
scm {
101+
connection.set("scm:git:git://github.com/hj4645/commit-chronicle.git")
102+
developerConnection.set("scm:git:ssh://git@github.com:hj4645/commit-chronicle.git")
103+
url.set("https://github.com/hj4645/commit-chronicle")
104+
tag.set("v0.1.0")
105+
}
106+
107+
issueManagement {
108+
system.set("GitHub Issues")
109+
url.set("https://github.com/hj4645/commit-chronicle/issues")
110+
}
111+
112+
ciManagement {
113+
system.set("GitHub Actions")
114+
url.set("https://github.com/hj4645/commit-chronicle/actions")
115+
}
116+
}
117+
}
118+
}
119+
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

jitpack.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
jdk:
2+
- openjdk8
3+
- openjdk11
4+
- openjdk17
5+
- openjdk21
6+
- openjdk24
7+
8+
before_install:
9+
- echo "Setting up build environment"
10+
- ./gradlew clean
11+
12+
install:
13+
- ./gradlew publishToMavenLocal
14+
15+
env:
16+
GRADLE_OPTS: "-Xmx2048m -XX:MaxMetaspaceSize=512m"

0 commit comments

Comments
 (0)