🧑‍💻 调整构建

This commit is contained in:
BTMuli
2025-11-22 13:40:57 +08:00
parent 256b529b16
commit 6af43bf957
3 changed files with 30 additions and 69 deletions

View File

@@ -66,7 +66,7 @@ jobs:
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.16.1
version: 10.23.0
- name: Install frontend dependencies
run: pnpm install

View File

@@ -68,58 +68,61 @@ jobs:
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.16.1
version: 10.23.0
- name: Install frontend dependencies
run: pnpm install
# 获取commit hash后续用这个做文件命名
- name: Get Commit Hash
id: get_commit_hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Build Debug
- name: Build debug app
uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: ${{ matrix.settings.args }} --debug
- name: Move Debug Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-debug == 'true'
run: mv src-tauri/target/x86_64-apple-darwin/debug/bundle/dmg/*.dmg TeyvatGuide_${{ env.COMMIT_HASH }}_intel-debug.dmg
- name: Move Debug ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-debug == 'true'
run: mv src-tauri/target/aarch64-apple-darwin/debug/bundle/dmg/*.dmg TeyvatGuide_${{ env.COMMIT_HASH }}_arm-debug.dmg
- name: Upload Debug Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-debug == 'true'
uses: actions/upload-artifact@v4
with:
name: debug-macos-intel
path: TeyvatGuide_${{ env.COMMIT_HASH }}_intel-debug.dmg
- name: Upload Debug ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-debug == 'true'
uses: actions/upload-artifact@v4
with:
name: debug-macos-arm
path: TeyvatGuide_${{ env.COMMIT_HASH }}_arm-debug.dmg
# Build Release
- name: Build app
uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: ${{ matrix.settings.args }}
# Build Debug
- name: Move Debug Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-debug == 'true'
run: mv src-tauri/target/x86_64-apple-darwin/debug/bundle/dmg/*.dmg intel-debug.dmg
- name: Move Debug ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-debug == 'true'
run: mv src-tauri/target/aarch64-apple-darwin/debug/bundle/dmg/*.dmg arm-debug.dmg
- name: Upload Debug Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-debug == 'true'
uses: actions/upload-artifact@v4
with:
name: debug-macos-intel
path: intel-debug.dmg
- name: Upload Debug ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-debug == 'true'
uses: actions/upload-artifact@v4
with:
name: debug-macos-arm
path: arm-debug.dmg
# Build Release
- name: Move Release Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-release == 'true'
run: mv src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg intel-release.dmg
run: mv src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg TeyvatGuide_${{ env.COMMIT_HASH }}_intel-release.dmg
- name: Move Release ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-release == 'true'
run: mv src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg arm-release.dmg
run: mv src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg TeyvatGuide_${{ env.COMMIT_HASH }}_arm-release.dmg
- name: Upload Release Intel
if: matrix.settings.target == 'macos-intel' && github.event.inputs.build-release
uses: actions/upload-artifact@v4
with:
name: release-macos-intel
path: intel-release.dmg
path: TeyvatGuide_${{ env.COMMIT_HASH }}_intel-release.dmg
- name: Upload Release ARM
if: matrix.settings.target == 'macos-arm' && github.event.inputs.build-release == 'true'
uses: actions/upload-artifact@v4
with:
name: release-macos-arm
path: arm-release.dmg
path: TeyvatGuide_${{ env.COMMIT_HASH }}_arm-release.dmg