File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ workflow_dispatch :
8
+
9
+ permissions :
10
+ contents : read
11
+
12
+ jobs :
13
+ build-and-test :
14
+ runs-on : ubuntu-latest
15
+ - uses : actions/checkout@v4
16
+
17
+ - name : Set up JDK 17
18
+ uses : actions/setup-java@v4
19
+ with :
20
+ java-version : ' 17'
21
+ distribution : ' temurin'
22
+
23
+ - name : Setup Gradle
24
+ uses : gradle/actions/setup-gradle@v3
25
+
26
+ - name : Publish package
27
+ run : ./gradlew publish
28
+ env :
29
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30
+ COMMIT_SHA : ${{ vars.GITHUB_SHA }}
Original file line number Diff line number Diff line change
1
+ import java.net.URI
2
+
1
3
plugins {
2
4
alias(libs.plugins.org.jetbrains.kotlin.jvm)
3
5
id(" java-library" )
6
+ id(" maven-publish" )
4
7
}
5
8
9
+ group = " org.dicio"
10
+ version = System .getenv(" COMMIT_SHA" )
11
+
6
12
kotlin {
7
13
jvmToolchain(17 )
8
14
}
@@ -11,3 +17,21 @@ dependencies {
11
17
implementation(libs.nanojson)
12
18
testImplementation(libs.junit)
13
19
}
20
+
21
+ publishing {
22
+ repositories {
23
+ maven {
24
+ name = " GitHubPackages"
25
+ url = URI (" https://maven.pkg.github.com/octocat/hello-world" )
26
+ credentials {
27
+ username = System .getenv(" GITHUB_ACTOR" )
28
+ password = System .getenv(" GITHUB_TOKEN" )
29
+ }
30
+ }
31
+ }
32
+ publications {
33
+ create<MavenPublication >(" mavenJava" ) {
34
+ from(components[" java" ])
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments