Skip to content

Commit

Permalink
修改构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
CSneko committed Aug 10, 2024
1 parent b2a7de2 commit 9d29d2f
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 107 deletions.
2 changes: 2 additions & 0 deletions .architectury-transformer/.fuse_hidden00003cb50000001c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Architectury Transformer DEBUG] Closed File Systems for /media/crystalneko/00053615000A874B/java/toNeko/common/build/libs/toneko-common-1.2.0.jar
[Architectury Transformer DEBUG] Closed File Systems for /media/crystalneko/00053615000A874B/java/toNeko/common/build/libs/toneko-common-1.2.0.jar
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Run DataGenera
run: ./gradlew runDatagen

- name: Build Mod
run: ./gradlew build
run: ./build.sh

- name: Upload JAR artifacts
uses: actions/upload-artifact@v4
with:
name: build results
path: ./build/libs/ # or path/to/artifact
path: ./result/ # or path/to/artifact

# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Run DataGenera
run: ./gradlew runDatagen
- name: Build Mod
run: ./build.sh

- name: Build
run: ./gradlew build

- name: Upload Release Assets
uses: softprops/action-gh-release@v2
Expand All @@ -35,5 +33,5 @@ jobs:
name: ${{ github.event.release.tag_name }} 更新
body: 发布 ${{ github.event.release.tag_name }}
files: |
build/libs/*
result/*
generate_notes: true
170 changes: 74 additions & 96 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
./gradlew runDatagen & # 将命令放入后台运行
pid=$! # 获取该命令的PID
sleep 60
kill -9 $pid # 60s后强制kill

./gradlew build
mkdir result
cp -r fabric/build/libs/* result
cp -r neoforge/build/libs/* result
4 changes: 4 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ shadowJar {
remapJar {
input.set shadowJar.archiveFile
}

fabricApi {
configureDataGeneration()
}
3 changes: 2 additions & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"suggests": {
"luckperms": "*",
"geckolib": "*"
"geckolib": "*",
"trinkets": "*"
},
"breaks": {
"optifabric": "*"
Expand Down

0 comments on commit 9d29d2f

Please sign in to comment.