Skip to content

Commit 6d33dc9

Browse files
committed
Make publishing step manually triggerable
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent e7a6ddf commit 6d33dc9

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ on:
44
push:
55
tags:
66
- "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
718

819
permissions:
920
contents: read
1021

1122
jobs:
1223
# Build all Python packages on Linux (pure + backend wheels).
1324
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') }}
1526
name: Build Linux packages
1627
runs-on: ubuntu-latest
1728
steps:
@@ -51,7 +62,7 @@ jobs:
5162

5263
# Build Windows-specific maturin backend wheels only.
5364
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') }}
5566
name: Build Windows backend wheels
5667
runs-on: windows-latest
5768
steps:
@@ -87,7 +98,7 @@ jobs:
8798

8899
# Merge artifacts from both platforms and publish to PyPI.
89100
publish:
90-
if: ${{ !github.event.act }}
101+
if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'python') }}
91102
name: Publish to PyPI
92103
needs: [build-linux, build-windows]
93104
runs-on: ubuntu-latest
@@ -115,7 +126,7 @@ jobs:
115126

116127
# Build the Windows native library for the .NET P/Invoke NuGet package.
117128
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') }}
119130
name: Build Windows .NET native library
120131
runs-on: windows-latest
121132
steps:
@@ -150,7 +161,7 @@ jobs:
150161

151162
# Build and publish .NET NuGet packages.
152163
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') }}
154165
name: Publish .NET NuGet packages
155166
needs: [dotnet-build-windows]
156167
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)