fix: add platform input options for workflow dispatch in dev.yml
This commit is contained in:
22
.github/workflows/dev.yml
vendored
22
.github/workflows/dev.yml
vendored
@@ -2,12 +2,17 @@ name: Development Test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
platforms:
|
||||||
|
description: "选择要运行的平台(逗号分隔,如 windows,macos-aarch64,macos-x86_64)"
|
||||||
|
required: false
|
||||||
|
default: "windows,macos-aarch64,macos-x86_64"
|
||||||
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
RUST_BACKTRACE: short
|
RUST_BACKTRACE: short
|
||||||
concurrency:
|
concurrency:
|
||||||
# only allow per workflow per commit (and not pr) to run at a time
|
|
||||||
group: "${{ github.workflow }} - ${{ github.head_ref || github.ref }}"
|
group: "${{ github.workflow }} - ${{ github.head_ref || github.ref }}"
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||||
|
|
||||||
@@ -20,46 +25,57 @@ jobs:
|
|||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
bundle: nsis
|
bundle: nsis
|
||||||
|
id: windows
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: aarch64-apple-darwin
|
target: aarch64-apple-darwin
|
||||||
bundle: dmg
|
bundle: dmg
|
||||||
|
id: 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
|
||||||
|
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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)
|
||||||
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"
|
||||||
@@ -77,7 +93,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'
|
if: matrix.os == 'macos-latest' && contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.target }}
|
name: ${{ matrix.target }}
|
||||||
@@ -85,7 +101,7 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest' && contains(github.event.inputs.platforms || 'windows,macos-aarch64,macos-x86_64', matrix.id)
|
||||||
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