File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build DEV Jars
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build_dev_jars :
7
+ name : Build DEV jars
8
+ runs-on : ubuntu-latest
9
+
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+ with :
13
+ fetch-depth : 0
14
+ - name : Setup JDK
15
+ uses : actions/setup-java@v2
16
+ with :
17
+ distribution : ' adopt'
18
+ java-version : ' 8'
19
+ - name : Make gradlew executable
20
+ run : chmod +x ./gradlew
21
+ - name : Build with Gradle
22
+ run : |
23
+ ./gradlew shadowJar snapshotVersion
24
+ git_hash=$(git rev-parse --short "$GITHUB_SHA")
25
+ echo "git_hash=$git_hash" >> $GITHUB_ENV
26
+ echo "snapshotVersion=$(cat build/versions/snapshot.txt)" >> $GITHUB_ENV
27
+ echo "artifactPath=$(pwd)/build/libs" >> $GITHUB_ENV
28
+ - name : Upload Plugin jar
29
+ uses : actions/upload-artifact@v3
30
+ with :
31
+ name : SimpleJoinMessage-${{ env.snapshotVersion }}-${{ env.git_hash }}.jar
32
+ path : ${{ env.artifactPath }}/SimpleJoinMessage-${{ env.snapshotVersion }}.jar
Original file line number Diff line number Diff line change
1
+ import java.nio.file.Files
2
+
1
3
plugins {
2
4
id ' com.github.johnrengelman.shadow' version ' 7.1.2'
3
5
id ' kr.entree.spigradle' version ' 2.4.2'
@@ -39,6 +41,10 @@ repositories {
39
41
url = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
40
42
}
41
43
44
+ maven {
45
+ url = " https://repo.fantasyrealms.net/releases"
46
+ }
47
+
42
48
maven { url ' https://jitpack.io' }
43
49
44
50
// Add your repositories here
@@ -131,3 +137,17 @@ tasks {
131
137
relocate(" kotlin" , " ${ libsPackage} .kotlin" )
132
138
}
133
139
}
140
+
141
+ abstract class PrintSnapshotVersionTask extends DefaultTask {
142
+ @TaskAction
143
+ def print () {
144
+ File versionsDir = project. file(" $project . buildDir /versions" )
145
+ File textFile = project. file(" $project . buildDir /versions/snapshot.txt" )
146
+ versionsDir. mkdirs()
147
+ Files . deleteIfExists(textFile. toPath())
148
+ textFile. createNewFile()
149
+ textFile << " $project . version "
150
+ }
151
+ }
152
+
153
+ tasks. register(' snapshotVersion' , PrintSnapshotVersionTask )
You can’t perform that action at this time.
0 commit comments