From dd73d3d3094fe83af91db3b008d48f33dee5890d Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 25 Jan 2026 16:35:41 +0800 Subject: [PATCH] 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. --- .github/workflows/release.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c35ccb5b66..b22effb11c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: