更新构建

This commit is contained in:
Color_yr committed 2026-07-11 19:50:07 +08:00
1 parent 2fe0c71d72
commit a3d4f25217
6 files changed
+72 -5

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: AllMusic OneJar
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- 'releases/**'
# Sequence of patterns matched against refs/tags
tags:
- '*'
permissions:
contents: write
jobs:
build_client:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: build
shell: cmd
run: |
gradlew :onejar:buildOneJar
- name: update
uses: actions/upload-artifact@v4
with:
name: "allmusic_onejar"
path: build/
- name: Create Pre-release and Upload Assets
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug')
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ github.ref_name }}
name: "Pre-release ${{ github.ref_name }}"
body: "自动构建的预发布版本"
files: |
build/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+11 -1
View File
@@ -12,7 +12,7 @@ allprojects {
apply(plugin = "com.gradleup.shadow")
group = "com.coloryr"
version = "4.0.3"
version = "4.1.0"
// 设置项目JDK版本
java.sourceCompatibility = JavaVersion.VERSION_1_8
@@ -65,3 +65,13 @@ allprojects {
}
}
}
tasks.register("buildAll") {
group = "build"
dependsOn(rootProject.subprojects.filter { it.path.startsWith(":client:") }
.map { it.tasks.named("build") })
dependsOn(rootProject.subprojects.filter { it.path.startsWith(":server:") }
.map { it.tasks.named("build") })
dependsOn(rootProject.subprojects.filter { it.path.startsWith(":onejar:") }
.map { it.tasks.named("build") })
}
+1 -1
View File
@@ -27,7 +27,7 @@ dependencies {
compileOnly("org.apache.logging.log4j:log4j-core:2.25.4")
}
tasks.register("buildOnJar") {
tasks.register("buildOneJar") {
group = "build"
dependsOn(rootProject.subprojects.filter { it.path.startsWith(":onejar:") }
.map { it.tasks.named("build") })
+1 -1
View File
@@ -52,7 +52,7 @@ tasks {
}
shadowJar {
archiveFileName.set("[fabric-26.2]AllMusic_Server-${project.version}.jar")
archiveFileName.set("[fabric-26.2]AllMusic-${project.version}.jar")
destinationDirectory.set(file("${parent!!.projectDir}/../build"))
// relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
@@ -18,7 +18,7 @@
"main": [
"com.coloryr.allmusic.comm.AllMusicInit",
"com.coloryr.allmusic.server.AllMusicServer"
],
]
},
"mixins": [
{
@@ -18,7 +18,7 @@
"main": [
"com.coloryr.allmusic.comm.AllMusicInit",
"com.coloryr.allmusic.server.AllMusicServer"
],
]
},
"mixins": [
{