File tree Expand file tree Collapse file tree 4 files changed +49
-5
lines changed
Expand file tree Collapse file tree 4 files changed +49
-5
lines changed Original file line number Diff line number Diff line change 1+ name : ProtocolLib development build
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+
15+ - name : Setup java
16+ uses : actions/setup-java@v4
17+ with :
18+ distribution : ' temurin'
19+ java-version : ' 21'
20+ cache : ' gradle'
21+
22+ - name : Run gradle build lifecycle
23+ run : |
24+ COMMIT_SHA=${{ github.sha }} ./gradlew build shadowJar --no-daemon
25+
26+ - name : Upload plugin file
27+ uses : actions/upload-artifact@v4
28+ with :
29+ name : ProtocolLib
30+ path : build/libs/ProtocolLib.jar
31+
32+ - name : Create or update GitHub pre-release
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ run : |
36+ COMMIT_MSG=$(git log -1 --pretty=%B)
37+ SHORT_HASH=$(echo "${{ github.sha }}" | cut -c1-7)
38+ RELEASE_NOTES=$(gh release view dev-build --repo ${{ github.repository }} --json body -q ".body" 2>/dev/null || echo "")
39+ gh release view dev-build --repo ${{ github.repository }} || \
40+ gh release create dev-build --prerelease --title "Development Build" --notes "## Changelog" --repo ${{ github.repository }}
41+ NEW_NOTES="$RELEASE_NOTES"$'\n'"* [$SHORT_HASH] $COMMIT_MSG"
42+ gh release edit dev-build --notes "$NEW_NOTES" --repo ${{ github.repository }}
43+ gh release upload dev-build build/libs/ProtocolLib.jar#ProtocolLib.jar --clobber --repo ${{ github.repository }}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ lead to more subtle bugs.
1414
1515* [ Spigot Page] ( https://spigotmc.org/resources/protocollib.1997/ )
1616* [ Releases] ( https://github.com/dmulloy2/ProtocolLib/releases )
17+ * [ Dev Build] ( https://github.com/dmulloy2/ProtocolLib/releases/tag/dev-build )
1718* [ JavaDoc] ( https://dmulloy2.net/ProtocolLib/javadoc/ )
1819* [ Protocol Wiki] ( https://minecraft.wiki/w/Minecraft_Wiki:Projects/wiki.vg_merge/Protocol )
1920
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ description = "Provides access to the Minecraft protocol"
1616
1717val mcVersion = " 1.21.8"
1818val isSnapshot = version.toString().endsWith(" -SNAPSHOT" )
19- val buildNumber = System .getenv(" BUILD_NUMBER " ) ? : " "
20- val isJenkins = buildNumber .isNotEmpty()
19+ val commitHash = System .getenv(" COMMIT_SHA " ) ? : " "
20+ val isCI = commitHash .isNotEmpty()
2121
2222repositories {
23- if (! isJenkins ) {
23+ if (! isCI ) {
2424 mavenLocal()
2525 }
2626
7575
7676tasks {
7777 processResources {
78- val fullVersion = if (isSnapshot && isJenkins ) " ${version} -${buildNumber } " else version
78+ val fullVersion = if (isSnapshot && isCI ) " ${version} -${commitHash.take( 7 ) } " else version
7979
8080 eachFile {
8181 expand(" version" to fullVersion)
Original file line number Diff line number Diff line change 1- version =5.4.0
1+ version =5.4.1-SNAPSHOT
22mavenCentralUsername =
33mavenCentralPassword =
44signing.keyId =
You can’t perform that action at this time.
0 commit comments