File tree Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Gradle Publish
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+
7
+ permissions :
8
+ checks : write
9
+ actions : read
10
+ contents : read
11
+
12
+ jobs :
13
+ build :
14
+ name : Gradle Test
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v3
18
+
19
+ - name : Set up Java JDK
20
+ uses : actions/setup-java@v3
21
+ with :
22
+ java-version : ' 19'
23
+ distribution : ' adopt'
24
+
25
+ - name : Gradle Wrapper Validation
26
+ uses : gradle/wrapper-validation-action@v1
27
+
28
+ - name : Setup Gradle with Dependency Cache
29
+
30
+
31
+ - name : Gradle Build
32
+ run : ./gradlew build --scan
33
+
34
+ - name : Gradle Test
35
+ run : ./gradlew test
36
+
37
+ - name : Publish Artifacts
38
+ uses : actions/upload-artifact@v3
39
+ with :
40
+ name : mcpm
41
+ path : build/libs
42
+
43
+ - name : Publish Maven Package to Github Package Registry
44
+ run : ./gradlew publish
45
+ env :
46
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47
+
48
+
Original file line number Diff line number Diff line change 37
37
with :
38
38
name : mcpm
39
39
path : build/libs
40
-
41
-
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' java'
3
+ id ' maven-publish'
3
4
}
4
5
5
6
group ' org.hydev.csc207'
@@ -43,6 +44,27 @@ dependencies {
43
44
testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.8.1'
44
45
}
45
46
47
+ publishing {
48
+ repositories {
49
+ maven {
50
+ name = " github"
51
+ url = " https://maven.pkg.github.com/CSC207-2022F-UofT/mcpm"
52
+ credentials {
53
+ username = System . getenv(" GITHUB_ACTOR" )
54
+ password = System . getenv(" GITHUB_TOKEN" )
55
+ }
56
+ }
57
+ }
58
+ publications {
59
+ register(" jar" , MavenPublication ) {
60
+ from(components[" java" ])
61
+ pom {
62
+ url. set(" https://github.com/CSC207-2022F-UofT/mcpm.git" )
63
+ }
64
+ }
65
+ }
66
+ }
67
+
46
68
if (hasProperty(' buildScan' )) {
47
69
buildScan {
48
70
termsOfServiceUrl = ' https://gradle.com/terms-of-service'
Original file line number Diff line number Diff line change 1
- rootProject. name = ' CSC207 '
1
+ rootProject. name = ' mcpm '
2
2
You can’t perform that action at this time.
0 commit comments