File tree Expand file tree Collapse file tree 2 files changed +62
-1
lines changed
Expand file tree Collapse file tree 2 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to Maven Repository
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ build-and-publish :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up JDK
17+ uses : actions/setup-java@v4
18+ with :
19+ distribution : ' temurin'
20+ java-version : 17
21+
22+ - name : Grant permissions
23+ run : chmod +x ./gradlew
24+
25+ - name : Cache Gradle dependencies
26+ uses : actions/cache@v4
27+ with :
28+ path : |
29+ ~/.gradle/caches
30+ ~/.gradle/wrapper
31+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
32+ restore-keys : |
33+ ${{ runner.os }}-gradle-
34+
35+ - name : Build and publish
36+ run : ./gradlew publish
37+ env :
38+ MAVEN_USERNAME : ${{ secrets.MAVEN_USERNAME }}
39+ MAVEN_PASSWORD : ${{ secrets.MAVEN_PASSWORD }}
Original file line number Diff line number Diff line change 11plugins {
22 `java- library`
3+ `maven- publish`
34 id(" java" )
45}
56
1011}
1112
1213allprojects {
13- group = " com.luminia "
14+ group = " com.luminiadev "
1415 version = " 1.0.6-SNAPSHOT"
1516}
1617
@@ -29,4 +30,25 @@ subprojects {
2930 api(" org.projectlombok:lombok:1.18.36" )
3031 annotationProcessor(" org.projectlombok:lombok:1.18.36" )
3132 }
33+
34+ publishing {
35+ publications {
36+ create<MavenPublication >(" maven" ) {
37+ groupId = project.group.toString()
38+ artifactId = project.name
39+ version = project.version.toString()
40+ from(components[" java" ])
41+ }
42+ }
43+ repositories {
44+ maven {
45+ name = " luminiadev"
46+ url = uri(" https://repo.luminiadev.com/snapshots" )
47+ credentials {
48+ username = System .getenv(" MAVEN_USERNAME" )
49+ password = System .getenv(" MAVEN_PASSWORD" )
50+ }
51+ }
52+ }
53+ }
3254}
You can’t perform that action at this time.
0 commit comments