Skip to content

Commit 3d8171e

Browse files
authored
Fix publish (#71)
* Fix publishing step for windows Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Make publishing step manually triggerable Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * install required tools Signed-off-by: James Sturtevant <jsturtevant@gmail.com> * Fix the steps so they actually fail independently Signed-off-by: James Sturtevant <jsturtevant@gmail.com> --------- Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 9dd6e0b commit 3d8171e

2 files changed

Lines changed: 61 additions & 20 deletions

File tree

.github/workflows/publish.yml

Lines changed: 54 additions & 13 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:
@@ -126,16 +137,31 @@ jobs:
126137
cache-key: release-windows-dotnet
127138
rustflags: ""
128139

140+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
141+
142+
- name: Install Python
143+
run: uv python install 3.12
144+
145+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
146+
with:
147+
node-version: "latest"
148+
cache: npm
149+
cache-dependency-path: src/wasm_sandbox/guests/javascript/package-lock.json
150+
129151
- name: Install just
130152
run: cargo install --locked just
131153

132154
- name: Install LLVM
133155
run: choco install llvm -y
134156

135-
- name: Build sandbox runtimes
136-
run: |
137-
just wasm build release
138-
just js build release
157+
- name: Build WASM sandbox runtime
158+
run: just wasm build release
159+
160+
- name: Build JavaScript sandbox runtime
161+
run: just js build release
162+
163+
- name: Compile WIT world
164+
run: just wasm guest-compile-wit
139165

140166
- name: Build Windows native library
141167
run: just dotnet build-rust release
@@ -147,7 +173,7 @@ jobs:
147173

148174
# Build and publish .NET NuGet packages.
149175
dotnet-publish:
150-
if: ${{ !github.event.act }}
176+
if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'dotnet') }}
151177
name: Publish .NET NuGet packages
152178
needs: [dotnet-build-windows]
153179
runs-on: ubuntu-latest
@@ -168,6 +194,17 @@ jobs:
168194
with:
169195
dotnet-version: '8.0.x'
170196

197+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
198+
199+
- name: Install Python
200+
run: uv python install 3.12
201+
202+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
203+
with:
204+
node-version: "latest"
205+
cache: npm
206+
cache-dependency-path: src/wasm_sandbox/guests/javascript/package-lock.json
207+
171208
- name: Install just
172209
run: cargo install --locked just
173210

@@ -181,10 +218,14 @@ jobs:
181218
sudo udevadm trigger --name-match=kvm
182219
sudo chmod 666 /dev/kvm
183220
184-
- name: Build sandbox runtimes
185-
run: |
186-
just wasm build release
187-
just js build release
221+
- name: Build WASM sandbox runtime
222+
run: just wasm build release
223+
224+
- name: Build JavaScript sandbox runtime
225+
run: just js build release
226+
227+
- name: Compile WIT world
228+
run: just wasm guest-compile-wit
188229

189230
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
190231
with:

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)