fix: add platform-specific input options for workflow dispatch in dev.yml
This commit is contained in:
40
.github/workflows/dev.yml
vendored
40
.github/workflows/dev.yml
vendored
@@ -3,10 +3,21 @@ name: Development Test
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
platforms:
|
run_windows:
|
||||||
description: "选择要运行的平台(逗号分隔,如 windows,macos-aarch64,macos-x86_64)"
|
description: "运行 Windows"
|
||||||
required: false
|
required: false
|
||||||
default: "windows,macos-aarch64,macos-x86_64"
|
type: boolean
|
||||||
|
default: true
|
||||||
|
run_macos_aarch64:
|
||||||
|
description: "运行 macOS aarch64"
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
run_macos_x86_64:
|
||||||
|
description: "运行 macOS x86_64"
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
env:
|
env:
|
||||||
@@ -26,56 +37,59 @@ jobs:
|
|||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
bundle: nsis
|
bundle: nsis
|
||||||
id: windows
|
id: windows
|
||||||
|
input: run_windows
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: aarch64-apple-darwin
|
target: aarch64-apple-darwin
|
||||||
bundle: dmg
|
bundle: dmg
|
||||||
id: macos-aarch64
|
id: macos-aarch64
|
||||||
|
input: run_macos_aarch64
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: x86_64-apple-darwin
|
target: x86_64-apple-darwin
|
||||||
bundle: dmg
|
bundle: dmg
|
||||||
id: macos-x86_64
|
id: macos-x86_64
|
||||||
|
input: run_macos_x86_64
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust Stable
|
- name: Install Rust Stable
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Add Rust Target
|
- name: Add Rust Target
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
run: rustup target add ${{ matrix.target }}
|
run: rustup target add ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: src-tauri
|
workspaces: src-tauri
|
||||||
save-if: false
|
save-if: false
|
||||||
|
|
||||||
- name: Install Node
|
- name: Install Node
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v4
|
||||||
name: Install pnpm
|
name: Install pnpm
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
with:
|
with:
|
||||||
run_install: false
|
run_install: false
|
||||||
|
|
||||||
- name: Pnpm install and check
|
- name: Pnpm install and check
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
run: |
|
run: |
|
||||||
pnpm i
|
pnpm i
|
||||||
pnpm run prebuild ${{ matrix.target }}
|
pnpm run prebuild ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Tauri build
|
- name: Tauri build
|
||||||
if: contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: github.event.inputs[matrix.input] == 'true'
|
||||||
uses: tauri-apps/tauri-action@v0
|
uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
@@ -93,7 +107,7 @@ jobs:
|
|||||||
args: --target ${{ matrix.target }} -b ${{ matrix.bundle }}
|
args: --target ${{ matrix.target }} -b ${{ matrix.bundle }}
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: matrix.os == 'macos-latest' && contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: matrix.os == 'macos-latest' && github.event.inputs[matrix.input] == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.target }}
|
name: ${{ matrix.target }}
|
||||||
@@ -101,7 +115,7 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: matrix.os == 'windows-latest' && contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
if: matrix.os == 'windows-latest' && github.event.inputs[matrix.input] == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.target }}
|
name: ${{ matrix.target }}
|
||||||
|
|||||||
Reference in New Issue
Block a user