Skip to content

Commit 733e750

Browse files
committed
Hopefully fix github actions build and publish
1 parent 059e220 commit 733e750

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

.github/workflows/publication.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ name: Publication
33
on:
44
push:
55
tags:
6-
- "*"
6+
- "mmc*"
77

88
jobs:
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
@@ -53,8 +51,3 @@ jobs:
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

build.gradle

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff 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
1515
group = "io.github.zekerzhayard"
1616
archivesBaseName = rootProject.name
1717

@@ -81,10 +81,3 @@ publishing {
8181
}
8282
}
8383
tasks.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-
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

22
org.gradle.daemon = false
33

4-
fw_version = multimc

0 commit comments

Comments
 (0)