File tree Expand file tree Collapse file tree 3 files changed +10
-25
lines changed
Expand file tree Collapse file tree 3 files changed +10
-25
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,19 @@ name: Publication
33on :
44 push :
55 tags :
6- - " *"
6+ - " mmc *"
77
88jobs :
99 build :
1010 runs-on : ubuntu-latest
1111
1212 steps :
13+ # Determine version based on the tag
14+ - id : version
15+ name : Write release version
16+ run : |
17+ echo Version: $GITHUB_REF_NAME
18+ echo "version=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
1319 - uses : actions/checkout@v4
1420 - name : Set up JDK
1521 uses : actions/setup-java@v4
@@ -20,18 +26,10 @@ jobs:
2026 - name : Build with Gradle
2127 env :
2228 IS_PUBLICATION : true
29+ VERSION : ${{ steps.version.outputs.version }}
2330 run : |
24- # git clone -b maven https://github.com/ZekerZhayard/ForgeWrapper.git ./build/maven
25- # rm -rf ./build/maven/.git/*
2631 chmod +x ./gradlew
27- ./gradlew publish -iS
28- - uses : actions/upload-artifact@v4
29- with :
30- name : Package
31- path : build/libs
32- - name : Get tag version
33- id : get_version
34- uses :
olegtarasov/[email protected] 32+ ./gradlew publish -iS -Pversion=${VERSION}
3533 - uses : actions/upload-artifact@v4
3634 with :
3735 name : Package
5351 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5452 with :
5553 asset_paths : ' ["./build/libs/*"]'
56- # - name: Upload to Maven
57- # uses: JamesIves/[email protected] 58- # with:
59- # branch: maven
60- # folder: build/maven
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ compileJava {
1111 sourceCompatibility = targetCompatibility = 1.8
1212}
1313
14- version = " ${ fw_version }${ -> getVersionSuffix() } "
14+ version = (findProperty( ' version ' ) == ' unspecified ' ) ? " LOCAL " : version
1515group = " io.github.zekerzhayard"
1616archivesBaseName = rootProject. name
1717
@@ -81,10 +81,3 @@ publishing {
8181 }
8282}
8383tasks. publish. dependsOn build
84-
85- static String getVersionSuffix () {
86- if (System . getenv(" IS_PUBLICATION" ) != null || System . getenv(" GITHUB_ACTIONS" ) == " true" )
87- return new SimpleDateFormat (" -yyyy-MM-dd" ). format(new Date ())
88-
89- return " -LOCAL"
90- }
Original file line number Diff line number Diff line change 11
22org.gradle.daemon = false
33
4- fw_version = multimc
You can’t perform that action at this time.
0 commit comments