From 7585551a3ded4698aa3e5731e8e1ab660bb0fd25 Mon Sep 17 00:00:00 2001 From: Color_yr <402067010@qq.com> Date: Sat, 6 Jun 2026 13:36:28 +0800 Subject: [PATCH] action --- .github/workflows/client.yml | 56 +++++++++ .github/workflows/onejar.yml | 227 ----------------------------------- .github/workflows/server.yml | 68 +++++++---- client | 2 +- qodana.yaml | 49 ++++++++ settings.gradle.kts | 12 +- 6 files changed, 155 insertions(+), 259 deletions(-) create mode 100644 .github/workflows/client.yml delete mode 100644 .github/workflows/onejar.yml create mode 100644 qodana.yaml diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml new file mode 100644 index 00000000..091f8bf6 --- /dev/null +++ b/.github/workflows/client.yml @@ -0,0 +1,56 @@ +# 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 Client + +on: + push: + # Sequence of patterns matched against refs/heads + branches: + - 'releases/**' + # Sequence of patterns matched against refs/tags + tags: + - '*' + +jobs: + build_onejar_fabric_1_16_5: + runs-on: windows-latest + permissions: + contents: read + 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 :client:buildClient + - name: update + uses: actions/upload-artifact@v4 + with: + name: "allmusic_client" + path: client/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: | + client/build/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/onejar.yml b/.github/workflows/onejar.yml deleted file mode 100644 index 87a328f3..00000000 --- a/.github/workflows/onejar.yml +++ /dev/null @@ -1,227 +0,0 @@ -# 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: - - '*' - -jobs: - build_onejar_fabric_1_16_5: - runs-on: windows-latest - permissions: - contents: read - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: 'true' - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 # v3.1.0 - - name: build - shell: cmd - run: | - link.cmd && cd onejar && cd fabric_1_16_5 && gradlew build - - name: update - if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') - uses: actions/upload-artifact@v4 - with: - name: "allmusic_onejar_fabric_1_16_5" - path: build/libs/ -# build_onejar_fabric_1_20_1: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd fabric_1_20_1 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_fabric_1_20_1" -# path: build/libs/ -# build_onejar_fabric_1_21: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd fabric_1_21 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_fabric_1_21" -# path: build/libs/ -# build_onejar_fabric_1_21_6: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd fabric_1_21_6 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_fabric_1_21_6" -# path: build/libs/ -# build_onejar_fabric_1_21_11: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd fabric_1_21_11 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_fabric_1_21_11" -# path: build/libs/ -# build_onejar_neoforge_1_21: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd neoforge_1_21 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_neoforge_1_21" -# path: build/libs/ -# build_onejar_neoforge_1_21_6: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd neoforge_1_21_6 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_neoforge_1_21_6" -# path: build/libs/ -# build_onejar_neoforge_1_21_11: -# runs-on: windows-latest -# permissions: -# contents: read -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# submodules: 'true' -# - name: Set up JDK 21 -# uses: actions/setup-java@v4 -# with: -# java-version: '21' -# distribution: 'temurin' -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@v3 # v3.1.0 -# - name: build -# shell: cmd -# run: | -# link.cmd && cd onejar && cd neoforge_1_21_11 && gradlew build -# - name: update -# if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') -# uses: actions/upload-artifact@v4 -# with: -# name: "allmusic_onejar_neoforge_1_21_11" -# path: build/libs/ \ No newline at end of file diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 1834cb13..ddbd06a2 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -1,38 +1,56 @@ -name: AllMusic Server +# 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 Client on: push: # Sequence of patterns matched against refs/heads - branches: + branches: - 'releases/**' # Sequence of patterns matched against refs/tags - tags: + tags: - '*' jobs: - build_all: + build_onejar_fabric_1_16_5: runs-on: windows-latest permissions: contents: read 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 # v3.1.0 - - name: build - shell: cmd - run: | - gradlew build - - name: update - if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'debug') - uses: actions/upload-artifact@v4 - with: - name: "allmusic_server" - path: build/ + - 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 :server:buildServer + - name: update + uses: actions/upload-artifact@v4 + with: + name: "allmusic_server" + 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 }} diff --git a/client b/client index 95b522a7..9fc6d071 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 95b522a7e275f3773ff8ddb561854f0fa541008c +Subproject commit 9fc6d071dae5fec591195f4eb1bb9add7b3bde86 diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 00000000..04f18672 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,49 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# + +################################################################################# +# WARNING: Do not store sensitive information in this file, # +# as its contents will be included in the Qodana report. # +################################################################################# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +projectJDK: "25" #(Applied in CI/CD pipeline) + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +# Quality gate. Will fail the CI/CD pipeline if any condition is not met +# severityThresholds - configures maximum thresholds for different problem severities +# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code +# Code Coverage is available in Ultimate and Ultimate Plus plans +#failureConditions: +# severityThresholds: +# any: 15 +# critical: 5 +# testCoverageThresholds: +# fresh: 70 +# total: 50 + +#Qodana supports other languages, for example, Python, JavaScript, TypeScript, Go, C#, PHP +#For all supported languages see https://www.jetbrains.com/help/qodana/linters.html +linter: jetbrains/qodana-jvm-community:2026.1 diff --git a/settings.gradle.kts b/settings.gradle.kts index 76e850aa..66ae14c8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,10 +17,10 @@ include(":client:fabric_1_21_11") project(":client:fabric_1_21_11").projectDir = file("client/client/fabric_1_21_11") include(":client:fabric_26_1") project(":client:fabric_26_1").projectDir = file("client/client/fabric_26_1") -include(":client:forge_1_7_10") -project(":client:forge_1_7_10").projectDir = file("client/client/forge_1_7_10") -include(":client:forge_1_12_2") -project(":client:forge_1_12_2").projectDir = file("client/client/forge_1_12_2") +//include(":client:forge_1_7_10") +//project(":client:forge_1_7_10").projectDir = file("client/client/forge_1_7_10") +//include(":client:forge_1_12_2") +//project(":client:forge_1_12_2").projectDir = file("client/client/forge_1_12_2") include(":client:forge_1_16_5") project(":client:forge_1_16_5").projectDir = file("client/client/forge_1_16_5") include(":client:forge_1_20_1") @@ -43,8 +43,8 @@ include(":server:fabric_1_21_6") include(":server:fabric_1_21_11") include(":server:fabric_26_1") -include(":server:forge_1_7_10") -include(":server:forge_1_12_2") +//include(":server:forge_1_7_10") +//include(":server:forge_1_12_2") include(":server:forge_1_16_5") include(":server:forge_1_20_1")