Skip to content

Commit d67df7d

Browse files
committed
Refactor CI to fix nighly builds (#14)
Also, group debug/release build under a single release in Github
1 parent c5a4977 commit d67df7d

File tree

7 files changed

+211
-179
lines changed

7 files changed

+211
-179
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
name: Build Dawn WebGPU Release
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
channel:
13+
description: "Chromium channel for Dawn"
14+
required: false
15+
default: "canary"
16+
type: choice
17+
options:
18+
- stable
19+
- beta
20+
- canary
21+
22+
workflow_call:
23+
inputs:
24+
channel:
25+
description: "Chromium channel for Dawn"
26+
required: true
27+
type: string
28+
29+
jobs:
30+
get-dawn-info:
31+
uses: ./.github/workflows/dawn-info.yaml
32+
with:
33+
channel: ${{ inputs.channel || github.event.inputs.channel }}
34+
35+
build-dawn-debug:
36+
needs: get-dawn-info
37+
uses: ./.github/workflows/dawn.yaml
38+
with:
39+
channel: ${{ inputs.channel || github.event.inputs.channel }}
40+
config: debug
41+
dawn_hash: ${{ needs.get-dawn-info.outputs.chromium_dawn_hash }}
42+
bundle_name: ${{ needs.get-dawn-info.outputs.tag }}-debug
43+
44+
build-dawn-release:
45+
needs: get-dawn-info
46+
uses: ./.github/workflows/dawn.yaml
47+
with:
48+
channel: ${{ inputs.channel || github.event.inputs.channel }}
49+
config: release
50+
dawn_hash: ${{ needs.get-dawn-info.outputs.chromium_dawn_hash }}
51+
bundle_name: ${{ needs.get-dawn-info.outputs.tag }}-release
52+
53+
create-release:
54+
needs: [build-dawn-debug, build-dawn-release, get-dawn-info]
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Download artifact bundles
58+
uses: actions/download-artifact@v5
59+
with:
60+
artifact-ids: ${{ needs.build-dawn-debug.outputs.artifact_id }},${{ needs.build-dawn-release.outputs.artifact_id }}
61+
path: dawn-bundles
62+
merge-multiple: true
63+
64+
- name: Create Release
65+
uses: ncipollo/release-action@v1
66+
with:
67+
name: Dawn WebGPU from Chromium ${{ needs.get-dawn-info.outputs.chromium_dawn_version }} (${{ needs.get-dawn-info.outputs.chromium_channel }})
68+
tag: ${{ needs.get-dawn-info.outputs.tag }}
69+
body: |
70+
**Chromium channel:** ${{ needs.get-dawn-info.outputs.chromium_channel }}
71+
**Chromium version:** ${{ needs.get-dawn-info.outputs.chromium_dawn_version }}
72+
**Dawn hash:** ${{ needs.get-dawn-info.outputs.chromium_dawn_hash }}
73+
74+
**Debug SHA256:** ${{ needs.build-dawn-debug.outputs.artifact_digest }}
75+
**Release SHA256:** ${{ needs.build-dawn-release.outputs.artifact_digest }}
76+
77+
This release contains pre-built Dawn WebGPU libraries in an archive bundle for multiple platforms:
78+
79+
- linux (x86_64)
80+
- macosx (x86_64 + ARM64)
81+
- iphoneos (ARM64)
82+
- iphonesimulator (x86_64)
83+
- windows (x86_64)
84+
85+
These are just the raw Dawn libraries and do not include the Swift API layer.
86+
artifacts: dawn-bundles/*
87+
artifactErrorsFailBuild: true
88+
removeArtifacts: true

.github/workflows/dawn-check.yaml

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,30 @@ on:
1919
- stable
2020
- beta
2121
- canary
22-
config:
23-
description: "Configuration"
24-
required: false
25-
default: "release"
26-
type: choice
27-
options:
28-
- release
29-
- debug
3022

3123
workflow_call:
3224
inputs:
3325
channel:
3426
description: "Chromium channel for Dawn (stable, beta, canary)"
3527
required: true
3628
type: string
37-
config:
38-
description: "Configuration (release or debug)"
39-
required: true
40-
type: string
4129

4230
jobs:
31+
get-dawn-info:
32+
uses: ./.github/workflows/dawn-info.yaml
33+
with:
34+
channel: ${{ inputs.channel || github.event.inputs.channel }}
35+
4336
check-dawn:
37+
needs: get-dawn-info
4438
runs-on: ubuntu-latest
4539
outputs:
4640
needs_build: ${{ steps.release_check.outputs.needs_build }}
47-
channel: ${{ steps.read-inputs.outputs.channel }}
48-
config: ${{ steps.read-inputs.outputs.config }}
41+
channel: ${{ needs.get-dawn-info.outputs.chromium_channel }}
42+
config: ${{ needs.get-dawn-info.outputs.chromium_dawn_suffix }}
4943
env:
5044
GH_TOKEN: ${{ github.token }}
5145
steps:
52-
- name: Read inputs
53-
id: read-inputs
54-
run: |
55-
echo "channel=${{ inputs.channel || github.event.inputs.channel }}" >> $GITHUB_OUTPUT
56-
echo "config=${{ inputs.config || github.event.inputs.config }}" >> $GITHUB_OUTPUT
57-
5846
- name: Checkout code
5947
uses: actions/checkout@v5
6048

@@ -72,43 +60,22 @@ jobs:
7260
- name: Get Dawn version
7361
run: |
7462
cd Dawn
75-
python ci_build_dawn.py get-dawn-version --channel ${{ steps.read-inputs.outputs.channel }}
76-
77-
- name: Read Dawn version
78-
id: read-version
79-
run: |
80-
cd Dawn
81-
value=$(jq -r '.chromium_channel' dawn_version.json)
82-
echo "chromium_channel=$value" >> $GITHUB_OUTPUT
83-
value=$(jq -r '.chromium_dawn_version' dawn_version.json)
84-
echo "chromium_dawn_version=$value" >> $GITHUB_OUTPUT
85-
value=$(jq -r '.chromium_dawn_hash' dawn_version.json)
86-
echo "chromium_dawn_hash=$value" >> $GITHUB_OUTPUT
87-
value=$(jq -r '.chromium_dawn_suffix' dawn_version.json)
88-
echo "chromium_dawn_suffix=$value" >> $GITHUB_OUTPUT
89-
90-
- name: Tag name
91-
id: tag
92-
run: |
93-
TAG="dawn-chromium-${{ steps.read-inputs.outputs.channel }}-${{steps.read-version.outputs.chromium_dawn_version}}-${{ steps.read-inputs.outputs.config }}"
94-
echo "tag=$TAG" >> $GITHUB_OUTPUT
63+
python ci_build_dawn.py get-dawn-version --channel ${{ needs.get-dawn-info.outputs.chromium_channel }}
9564
9665
- name: Run Dawn build if necessary
9766
id: release_check
9867
run: |
99-
TAG="${{ steps.tag.outputs.tag }}"
100-
if gh release view "$TAG" >/dev/null 2>&1; then
101-
echo "Release '$TAG' already exists. Skipping build."
68+
if gh release view "${{ needs.get-dawn-info.outputs.tag }}" >/dev/null 2>&1; then
69+
echo "Release '"${{ needs.get-dawn-info.outputs.tag }}"' already exists. Skipping build."
10270
echo "needs_build=false" >> $GITHUB_OUTPUT
10371
else
104-
echo "Starting build for release: $TAG"
72+
echo "Starting build for release: ${{ needs.get-dawn-info.outputs.tag }}"
10573
echo "needs_build=true" >> $GITHUB_OUTPUT
10674
fi
10775
10876
build-dawn:
10977
if: ${{ needs.check-dawn.outputs.needs_build == 'true' }}
11078
needs: check-dawn
111-
uses: ./.github/workflows/dawn.yaml
79+
uses: ./.github/workflows/dawn-build-release.yaml
11280
with:
11381
channel: ${{ needs.check-dawn.outputs.channel }}
114-
config: ${{ needs.check-dawn.outputs.config }}

.github/workflows/dawn-info.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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: Get info about latest Dawn for channel
9+
10+
on:
11+
workflow_call:
12+
inputs:
13+
channel:
14+
description: "Chromium channel for Dawn"
15+
required: true
16+
type: string
17+
outputs:
18+
chromium_channel:
19+
description: "Chromium channel for Dawn"
20+
value: ${{ jobs.get-dawn-info.outputs.chromium_channel }}
21+
chromium_dawn_version:
22+
description: "Version of Chromium matching Dawn"
23+
value: ${{ jobs.get-dawn-info.outputs.chromium_dawn_version }}
24+
chromium_dawn_hash:
25+
description: "Git hash of Dawn code"
26+
value: ${{ jobs.get-dawn-info.outputs.chromium_dawn_hash }}
27+
chromium_dawn_suffix:
28+
description: "Suffix for Dawn tag"
29+
value: ${{ jobs.get-dawn-info.outputs.chromium_dawn_suffix }}
30+
tag:
31+
description: "Tag for Dawn release"
32+
value: ${{ jobs.get-dawn-info.outputs.dawn_tag }}
33+
34+
jobs:
35+
get-dawn-info:
36+
runs-on: ubuntu-latest
37+
outputs:
38+
chromium_channel: ${{ steps.read-version.outputs.chromium_channel }}
39+
chromium_dawn_version: ${{ steps.read-version.outputs.chromium_dawn_version }}
40+
chromium_dawn_hash: ${{ steps.read-version.outputs.chromium_dawn_hash }}
41+
chromium_dawn_suffix: ${{ steps.read-version.outputs.chromium_dawn_suffix }}
42+
dawn_tag: ${{ steps.tag.outputs.tag }}
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v5
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v6
49+
with:
50+
python-version: "3.13"
51+
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
cd Dawn
56+
pip install -r requirements.txt
57+
58+
- name: Get Dawn version
59+
run: |
60+
cd Dawn
61+
python ci_build_dawn.py get-dawn-version --channel ${{ inputs.channel }}
62+
63+
- name: Read Dawn version
64+
id: read-version
65+
run: |
66+
cd Dawn
67+
value=$(jq -r '.chromium_channel' dawn_version.json)
68+
echo "chromium_channel=$value" >> $GITHUB_OUTPUT
69+
value=$(jq -r '.chromium_dawn_version' dawn_version.json)
70+
echo "chromium_dawn_version=$value" >> $GITHUB_OUTPUT
71+
value=$(jq -r '.chromium_dawn_hash' dawn_version.json)
72+
echo "chromium_dawn_hash=$value" >> $GITHUB_OUTPUT
73+
value=$(jq -r '.chromium_dawn_suffix' dawn_version.json)
74+
echo "chromium_dawn_suffix=$value" >> $GITHUB_OUTPUT
75+
76+
- name: Tag name
77+
id: tag
78+
run: |
79+
TAG="dawn-chromium-${{ steps.read-version.outputs.chromium_channel }}-${{steps.read-version.outputs.chromium_dawn_version}}"
80+
echo "tag=$TAG" >> $GITHUB_OUTPUT

.github/workflows/dawn-nightly-release.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/dawn-nightly-debug.yaml renamed to .github/workflows/dawn-nightly.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ jobs:
1616
uses: ./.github/workflows/dawn-check.yaml
1717
with:
1818
channel: canary
19-
config: debug

0 commit comments

Comments
 (0)