|
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - "v*" |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + publish_target: |
| 10 | + description: "What to run" |
| 11 | + required: true |
| 12 | + type: choice |
| 13 | + options: |
| 14 | + - all |
| 15 | + - python |
| 16 | + - dotnet |
| 17 | + default: all |
7 | 18 |
|
8 | 19 | permissions: |
9 | 20 | contents: read |
10 | 21 |
|
11 | 22 | jobs: |
12 | 23 | # Build all Python packages on Linux (pure + backend wheels). |
13 | 24 | build-linux: |
14 | | - if: ${{ !github.event.act }} |
| 25 | + if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'python') }} |
15 | 26 | name: Build Linux packages |
16 | 27 | runs-on: ubuntu-latest |
17 | 28 | steps: |
|
51 | 62 |
|
52 | 63 | # Build Windows-specific maturin backend wheels only. |
53 | 64 | build-windows: |
54 | | - if: ${{ !github.event.act }} |
| 65 | + if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'python') }} |
55 | 66 | name: Build Windows backend wheels |
56 | 67 | runs-on: windows-latest |
57 | 68 | steps: |
|
87 | 98 |
|
88 | 99 | # Merge artifacts from both platforms and publish to PyPI. |
89 | 100 | publish: |
90 | | - if: ${{ !github.event.act }} |
| 101 | + if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'python') }} |
91 | 102 | name: Publish to PyPI |
92 | 103 | needs: [build-linux, build-windows] |
93 | 104 | runs-on: ubuntu-latest |
@@ -115,7 +126,7 @@ jobs: |
115 | 126 |
|
116 | 127 | # Build the Windows native library for the .NET P/Invoke NuGet package. |
117 | 128 | dotnet-build-windows: |
118 | | - if: ${{ !github.event.act }} |
| 129 | + if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'dotnet') }} |
119 | 130 | name: Build Windows .NET native library |
120 | 131 | runs-on: windows-latest |
121 | 132 | steps: |
@@ -150,7 +161,7 @@ jobs: |
150 | 161 |
|
151 | 162 | # Build and publish .NET NuGet packages. |
152 | 163 | dotnet-publish: |
153 | | - if: ${{ !github.event.act }} |
| 164 | + if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'dotnet') }} |
154 | 165 | name: Publish .NET NuGet packages |
155 | 166 | needs: [dotnet-build-windows] |
156 | 167 | runs-on: ubuntu-latest |
|
0 commit comments