From c9b9e0eefe1a27f1ae379ff3a6c855303cb3b461 Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Wed, 18 Mar 2026 22:30:37 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/buildAndRelease.yml | 22 ++++++++++++++++------ gradle.properties | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/buildAndRelease.yml b/.github/workflows/buildAndRelease.yml index 1999628..d1d4e65 100644 --- a/.github/workflows/buildAndRelease.yml +++ b/.github/workflows/buildAndRelease.yml @@ -83,7 +83,18 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Determine version type + id: version_type + run: | + if [[ "${{ github.ref_name }}" == *"alpha"* ]]; then + echo "type=alpha" >> $GITHUB_OUTPUT + elif [[ "${{ github.ref_name }}" == *"beta"* ]]; then + echo "type=beta" >> $GITHUB_OUTPUT + elif [[ "${{ github.ref_name }}" == *"rc"* ]]; then + echo "type=beta" >> $GITHUB_OUTPUT + else + echo "type=release" >> $GITHUB_OUTPUT + fi - name: Download artifacts uses: actions/download-artifact@v4 with: @@ -344,14 +355,14 @@ jobs: dist/${{ steps.version_info.outputs.mod_id }}-fabric-${{ steps.version_info.outputs.minecraft_version }}-${{ steps.version_info.outputs.version }}-sources.jar # 版本信息 - name: "${{ steps.version_info.outputs.mod_name }} ${{ steps.version_info.outputs.version }} (Fabric/${{ steps.version_info.outputs.minecraft_version }})" + name: ${{ steps.version_info.outputs.mod_name }} ${{ steps.version_info.outputs.version }} (Fabric/${{ steps.version_info.outputs.minecraft_version }}) version: ${{ steps.version_info.outputs.version }}-fabric # 更新日志 changelog: ${{ steps.generate_changelog.outputs.changelog }} # 版本类型 - version-type: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') && 'beta' || 'release' }} + version-type: ${{ steps.version_type.outputs.type }} # 只指定 Fabric 加载器 loaders: fabric @@ -375,7 +386,6 @@ jobs: curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} curseforge-dependencies: ${{ steps.version_info.outputs.fabric_curseforge_dependencies }} - # 失败处理 fail-mode: skip @@ -392,14 +402,14 @@ jobs: dist/${{ steps.version_info.outputs.mod_id }}-forge-${{ steps.version_info.outputs.minecraft_version }}-${{ steps.version_info.outputs.version }}-sources.jar # 版本信息 - name: "${{ steps.version_info.outputs.mod_name }} ${{ steps.version_info.outputs.version }} (Forge/${{ steps.version_info.outputs.minecraft_version }})" + name: ${{ steps.version_info.outputs.mod_name }} ${{ steps.version_info.outputs.version }} (Forge/${{ steps.version_info.outputs.minecraft_version }}) version: ${{ steps.version_info.outputs.version }}-forge # 更新日志 changelog: ${{ steps.generate_changelog.outputs.changelog }} # 版本类型 - version-type: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') && 'beta' || 'release' }} + version-type: ${{ steps.version_type.outputs.type }} # 只指定 Forge 加载器 loaders: forge diff --git a/gradle.properties b/gradle.properties index 853d82e..9324c15 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ # Every field you add must be added to buildSrc/src/main/groovy/multiloader-common.gradle expandProps map. # Project -version=0.5.3-beta +version=0.5.4-beta group=top.r3944realms.lib39 java_version=17