Skip to content

Commit d629894

Browse files
authored
Get releases of Dawn artifact bundles fully working in CI (#4)
1 parent b79adff commit d629894

File tree

6 files changed

+87
-69
lines changed

6 files changed

+87
-69
lines changed

.github/workflows/dawn-check.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ on:
2828
- release
2929
- debug
3030

31+
workflow_call:
32+
inputs:
33+
channel:
34+
required: false
35+
default: "canary"
36+
description: "Chromium channel for Dawn (stable, beta, canary)"
37+
type: string
38+
config:
39+
description: "Configuration (release or debug)"
40+
required: false
41+
default: "release"
42+
type: string
43+
3144
jobs:
3245
check-dawn:
3346
runs-on: ubuntu-latest
@@ -83,7 +96,7 @@ jobs:
8396
echo "Uploading to release: $TAG"
8497
echo "needs_build=true" >> $GITHUB_OUTPUT
8598
fi
86-
99+
87100
build-dawn:
88101
if: ${{ needs.check-dawn.outputs.needs_build == 'true' }}
89102
needs: check-dawn
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2025 Adobe
2+
# All Rights Reserved.
3+
#
4+
# NOTICE: Adobe permits you to use, modify, and distribute this file in
5+
# accordance with the terms of the Adobe license agreement accompanying
6+
# it.
7+
8+
name: Dawn Nightly Debug Build
9+
10+
on:
11+
schedule:
12+
- cron: "0 8 * * *"
13+
14+
jobs:
15+
build-dawn-if-needed:
16+
uses: ./.github/workflows/dawn-check.yaml
17+
with:
18+
channel: canary
19+
config: debug
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2025 Adobe
2+
# All Rights Reserved.
3+
#
4+
# NOTICE: Adobe permits you to use, modify, and distribute this file in
5+
# accordance with the terms of the Adobe license agreement accompanying
6+
# it.
7+
8+
name: Dawn Nightly Release Build
9+
10+
on:
11+
schedule:
12+
- cron: "0 7 * * *"
13+
14+
jobs:
15+
build-dawn-if-needed:
16+
uses: ./.github/workflows/dawn-check.yaml
17+
with:
18+
channel: canary
19+
config: release

.github/workflows/dawn.yaml

Lines changed: 25 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,15 @@ on:
3030
workflow_call:
3131
inputs:
3232
channel:
33-
description: "Chromium channel for Dawn"
3433
required: false
3534
default: "canary"
36-
type: choice
37-
options:
38-
- stable
39-
- beta
40-
- canary
35+
description: "Chromium channel for Dawn (stable, beta, canary)"
36+
type: string
4137
config:
42-
description: "Configuration"
38+
description: "Configuration (release or debug)"
4339
required: false
4440
default: "release"
45-
type: choice
46-
options:
47-
- release
48-
- debug
49-
secrets:
50-
GITHUB_TOKEN:
51-
required: true
41+
type: string
5242

5343
jobs:
5444
get-dawn-version:
@@ -109,9 +99,9 @@ jobs:
10999
- platform: macos-latest
110100
target: macosx
111101
python-version: "3.11"
112-
# - platform: windows-latest
113-
# target: windows
114-
# python-version: "3.11"
102+
- platform: windows-latest
103+
target: windows
104+
python-version: "3.11"
115105
- platform: macos-latest
116106
target: iphoneos
117107
python-version: "3.11"
@@ -150,7 +140,7 @@ jobs:
150140
- name: Build Dawn for ${{ matrix.target }}
151141
run: |
152142
cd Dawn
153-
python ci_build_dawn.py build-target --target ${{ matrix.target }} --config ${{ env.DAWN_CONFIG }}
143+
python ci_build_dawn.py build-target --target ${{ matrix.target }} --config ${{ github.event.inputs.config }}
154144
155145
- name: Upload build artifacts
156146
uses: actions/upload-artifact@v4
@@ -220,69 +210,40 @@ jobs:
220210
BUNDLE_NAME="dawn_webgpu_${{needs.get-dawn-version.outputs.chromium_dawn_suffix}}.zip"
221211
echo "bundle_name=$BUNDLE_NAME" >> $GITHUB_OUTPUT
222212
223-
- name: Upload bundle artifact
224-
uses: actions/upload-artifact@v4
225-
with:
226-
name: dawn-webgpu-bundle
227-
path: Dawn/dist/${{steps.set-bundle-name.outputs.bundle_name}}
228-
retention-days: 30
229-
230-
create-release:
231-
needs: [create-bundle, get-dawn-version]
232-
runs-on: ubuntu-latest
233-
steps:
234-
- name: Checkout code
235-
uses: actions/checkout@v4
236-
237-
- name: Download bundle artifact
238-
uses: actions/download-artifact@v5
239-
with:
240-
name: dawn-webgpu-bundle
241-
path: dawn-bundle/
242-
merge-multiple: true
243-
244213
- name: Compute SHA256
245214
id: compute-sha256
246215
run: |
247-
cd dawn-bundle
248-
sha256sum ${{needs.create-bundle.outputs.bundle_name}} > sha256sum.txt
216+
cd Dawn/dist
217+
sha256sum ${{steps.set-bundle-name.outputs.bundle_name}} > sha256sum.txt
249218
echo "sha256sum=$(cat sha256sum.txt)" >> $GITHUB_OUTPUT
250219
251220
- name: Tag name
252221
id: tag
253222
run: |
254-
TAG="dawn-chromium-${{github.event.inputs.channel}}-${{needs.get-dawn-version.outputs.chromium_dawn_version}}"
223+
TAG="dawn-chromium-${{github.event.inputs.channel}}-${{needs.get-dawn-version.outputs.chromium_dawn_version}}-${{github.event.inputs.config}}"
255224
echo "tag=$TAG" >> $GITHUB_OUTPUT
256225
257226
- name: Create Release
258-
uses: actions/create-release@v1
259-
env:
260-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227+
uses: ncipollo/release-action@v1
261228
with:
262-
release_name: Dawn WebGPU from Chromium ${{ needs.get-dawn-version.outputs.chromium_dawn_version }}
263-
tag_name: ${{ steps.tag.outputs.tag }}
229+
name: Dawn WebGPU from Chromium ${{ needs.get-dawn-version.outputs.chromium_dawn_version }} (${{ github.event.inputs.config }})
230+
tag: ${{ steps.tag.outputs.tag }}
264231
body: |
265-
Dawn WebGPU build matching Chromium ${{ needs.get-dawn-version.outputs.chromium_dawn_version }}.
266-
Built from Dawn hash: ${{ needs.get-dawn-version.outputs.chromium_dawn_hash }}
267-
SHA256: ${{ steps.compute-sha256.outputs.sha256sum }}
232+
**Chromium channel:** ${{ github.event.inputs.channel }}
233+
**Chromium version:** ${{ needs.get-dawn-version.outputs.chromium_dawn_version }}
234+
**Configuration:** ${{ github.event.inputs.config }}
235+
**Dawn hash:** ${{ needs.get-dawn-version.outputs.chromium_dawn_hash }}
236+
**SHA256:** ${{ steps.compute-sha256.outputs.sha256sum }}
237+
238+
This release contains pre-built Dawn WebGPU libraries in an archive bundle for multiple platforms:
268239
269-
This release contains pre-built Dawn WebGPU libraries for multiple platforms:
270240
- linux (x86_64)
271241
- macosx (x86_64 + ARM64)
272242
- iphoneos (ARM64)
273243
- iphonesimulator (x86_64)
244+
- windows (x86_64)
274245
275246
These are just the raw Dawn libraries and do not include the Swift API layer.
276-
277-
Built from Chromium channel: ${{ github.event.inputs.channel }}
278-
draft: false
279-
prerelease: false
280-
281-
- name: Upload Release Assets
282-
run: |
283-
TAG="${{ steps.tag.outputs.tag }}"
284-
echo "Uploading to release: $TAG"
285-
cd dawn-bundle
286-
gh release upload $TAG ${{needs.create-bundle.outputs.bundle_name}} --clobber
287-
env:
288-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247+
artifacts: Dawn/dist/${{steps.set-bundle-name.outputs.bundle_name}}
248+
artifactErrorsFailBuild: true
249+
removeArtifacts: true

Dawn/archive_builder.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def write_target_manifest(
2828
target_dir = build_dir / str(target_config) / "install"
2929
manifest = {
3030
"targetName": str(target_config),
31-
"libraryPath": str(target_dir / "lib"),
32-
"includePath": str(target_dir / "include"),
31+
"libraryPath": (target_dir / "lib").as_posix(),
32+
"includePath": (target_dir / "include").as_posix(),
3333
"supportedTriples": target_config.triples(),
3434
"libraryName": "libwebgpu_dawn.lib"
3535
if target_config.os.is_windows()
@@ -165,7 +165,9 @@ def create_artifact_bundle(version: str, archive_name: str) -> pathlib.Path:
165165
archive_path.unlink()
166166

167167
shutil.make_archive(
168-
archive_path, "zip", root_dir=dist_directory(), base_dir=archive_dir.name
168+
archive_path, "zip",
169+
root_dir=dist_directory(),
170+
base_dir=archive_dir.name,
169171
)
170172

171173
return archive_path

Dawn/ci_build_dawn.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ def parse_args() -> argparse.Namespace:
8787
help="Chromium channel to use for Dawn",
8888
)
8989

90-
get_parser = subparsers.add_parser("get-source", help="Get the Dawn source")
90+
get_parser = subparsers.add_parser(
91+
"get-source",
92+
help="Get the Dawn source"
93+
)
9194
get_parser.add_argument(
9295
"--hash",
9396
required=True,
@@ -135,6 +138,7 @@ def main() -> int:
135138
"macosx",
136139
"iphoneos",
137140
"iphonesimulator",
141+
"windows",
138142
]:
139143
print(f"Invalid target: {args.target}")
140144
return _EXIT_FAILURE

0 commit comments

Comments
 (0)