feat(release): add platform input for release workflow and adjust OS matrix based on input

- Introduced a new input parameter 'platform' to specify the build platform (all, windows, mac, linux).
- Updated the job strategy matrix to dynamically select OS based on the provided platform input, enhancing flexibility in the release process.
This commit is contained in:
kangfenmao 2026-01-25 16:35:41 +08:00
parent 8ab07e9e4c
commit dd73d3d309

View File

@ -7,6 +7,16 @@ on:
description: "Release tag (e.g. v1.0.0)"
required: true
default: "v1.0.0"
platform:
description: "Build platform"
required: true
default: "all"
type: choice
options:
- all
- windows
- mac
- linux
push:
tags:
- v*.*.*
@ -20,7 +30,14 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
os: ${{ fromJSON(
github.event_name == 'push' && '["macos-latest", "windows-latest", "ubuntu-latest"]' ||
github.event.inputs.platform == 'all' && '["macos-latest", "windows-latest", "ubuntu-latest"]' ||
github.event.inputs.platform == 'linux' && '["ubuntu-latest"]' ||
github.event.inputs.platform == 'windows' && '["windows-latest"]' ||
github.event.inputs.platform == 'mac' && '["macos-latest"]' ||
'["macos-latest", "windows-latest", "ubuntu-latest"]'
) }}
fail-fast: false
steps: