Skip to content

Commit 34d6f01

Browse files
committed
WIP
1 parent a2eb23b commit 34d6f01

File tree

2 files changed

+113
-6
lines changed

2 files changed

+113
-6
lines changed

.github/workflows/dawn-check.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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: Check if Dawn is up to date
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
channel:
14+
description: "Chromium channel for Dawn"
15+
required: false
16+
default: "canary"
17+
type: choice
18+
options:
19+
- stable
20+
- beta
21+
- canary
22+
config:
23+
description: "Configuration"
24+
required: false
25+
default: "release"
26+
type: choice
27+
options:
28+
- release
29+
- debug
30+
31+
jobs:
32+
check-dawn:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
needs_build: ${{ steps.release_check.outputs.needs_build }}
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: "3.11"
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
cd Dawn
49+
pip install -r requirements.txt
50+
51+
- name: Get Dawn version
52+
run: |
53+
cd Dawn
54+
python ci_build_dawn.py get-dawn-version --channel ${{ github.event.inputs.channel }}
55+
56+
- name: Read Dawn version
57+
id: read-version
58+
run: |
59+
cd Dawn
60+
value=$(jq -r '.chromium_channel' dawn_version.json)
61+
echo "chromium_channel=$value" >> $GITHUB_OUTPUT
62+
value=$(jq -r '.chromium_dawn_version' dawn_version.json)
63+
echo "chromium_dawn_version=$value" >> $GITHUB_OUTPUT
64+
value=$(jq -r '.chromium_dawn_hash' dawn_version.json)
65+
echo "chromium_dawn_hash=$value" >> $GITHUB_OUTPUT
66+
value=$(jq -r '.chromium_dawn_suffix' dawn_version.json)
67+
echo "chromium_dawn_suffix=$value" >> $GITHUB_OUTPUT
68+
69+
- name: Tag name
70+
id: tag
71+
run: |
72+
TAG="dawn-chromium-${{github.event.inputs.channel}}-${{steps.read-version.outputs.chromium_dawn_version}}-${{github.event.inputs.config}}"
73+
echo "tag=$TAG" >> $GITHUB_OUTPUT
74+
75+
- name: Run Dawn build if necessary
76+
id: release_check
77+
run: |
78+
TAG="${{ steps.tag.outputs.tag }}"
79+
if gh release view "$TAG" >/dev/null 2>&1; then
80+
echo "Release '$TAG' already exists. Skipping upload."
81+
echo "needs_build=false" >> $GITHUB_OUTPUT
82+
else
83+
echo "Uploading to release: $TAG"
84+
echo "needs_build=true" >> $GITHUB_OUTPUT
85+
fi

.github/workflows/dawn.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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.
17
name: Build Dawn WebGPU
28

39
on:
@@ -21,9 +27,25 @@ on:
2127
- release
2228
- debug
2329

24-
env:
25-
DAWN_CHANNEL: ${{ github.event.inputs.channel || 'canary' }}
26-
DAWN_CONFIG: ${{ github.event.inputs.config || 'release' }}
30+
workflow_call:
31+
inputs:
32+
channel:
33+
description: "Chromium channel for Dawn"
34+
required: false
35+
default: "canary"
36+
type: choice
37+
options:
38+
- stable
39+
- beta
40+
- canary
41+
config:
42+
description: "Configuration"
43+
required: false
44+
default: "release"
45+
type: choice
46+
options:
47+
- release
48+
- debug
2749

2850
jobs:
2951
get-dawn-version:
@@ -51,7 +73,7 @@ jobs:
5173
- name: Get Dawn version
5274
run: |
5375
cd Dawn
54-
python ci_build_dawn.py get-dawn-version --channel ${{ env.DAWN_CHANNEL }}
76+
python ci_build_dawn.py get-dawn-version --channel ${{ github.event.inputs.channel }}
5577
5678
- name: Upload Dawn Version
5779
uses: actions/upload-artifact@v4
@@ -226,7 +248,7 @@ jobs:
226248
- name: Tag name
227249
id: tag
228250
run: |
229-
TAG="dawn-chromium-${{env.DAWN_CHANNEL}}-${{needs.get-dawn-version.outputs.chromium_dawn_version}}"
251+
TAG="dawn-chromium-${{github.event.inputs.channel}}-${{needs.get-dawn-version.outputs.chromium_dawn_version}}"
230252
echo "tag=$TAG" >> $GITHUB_OUTPUT
231253
232254
- name: Create Release
@@ -249,7 +271,7 @@ jobs:
249271
250272
These are just the raw Dawn libraries and do not include the Swift API layer.
251273
252-
Built from Chromium channel: ${{ env.DAWN_CHANNEL }}
274+
Built from Chromium channel: ${{ github.event.inputs.channel }}
253275
draft: false
254276
prerelease: false
255277

0 commit comments

Comments
 (0)