Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Prepare Release

on:
workflow_dispatch:

jobs:
prepare:
name: Create Release PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Determine next RC version
id: version
run: |
# Find highest RC number from existing tags
HIGHEST_RC=0
for tag in $(git tag -l 'v0.2.0-rc.*'); do
if [[ "$tag" =~ ^v0\.2\.0-rc\.([0-9]+)$ ]]; then
RC_NUM="${BASH_REMATCH[1]}"
if [ "$RC_NUM" -gt "$HIGHEST_RC" ]; then
HIGHEST_RC="$RC_NUM"
fi
fi
done

NEXT_RC=$((HIGHEST_RC + 1))
VERSION="0.2.0-rc.${NEXT_RC}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Preparing version: $VERSION"

- name: Bump package versions
run: |
VERSION="${{ steps.version.outputs.version }}"

# Update version for all wasi-gfx packages (but not external deps like wasi:io)
for pkg in graphics-context webgpu surface frame-buffer; do
find . -name "*.wit" -not -path "*/generate/*" -exec sed -i \
"s/\(wasi:${pkg}@\)[^;, }]*/\1${VERSION}/g" {} +
done

- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
commit-message: "chore: bump version to ${{ steps.version.outputs.version }}"
branch: release/${{ steps.version.outputs.version }}
title: "Release ${{ steps.version.outputs.version }}"
body: |
Bumps package version to `${{ steps.version.outputs.version }}`.

Once merged, manually run the **Publish Release** workflow to:
- Create git tag `v${{ steps.version.outputs.version }}`
- Create GitHub release
- Publish packages to GHCR:
- `ghcr.io/webassembly/wasi/graphics-context:${{ steps.version.outputs.version }}`
- `ghcr.io/webassembly/wasi/webgpu:${{ steps.version.outputs.version }}`
- `ghcr.io/webassembly/wasi/surface:${{ steps.version.outputs.version }}`
- `ghcr.io/webassembly/wasi/frame-buffer:${{ steps.version.outputs.version }}`
160 changes: 160 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Publish Release

on:
workflow_dispatch:

jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: write
attestations: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Extract version from package
id: version
run: |
# Extract version from graphics-context (canonical source)
VERSION=$(sed -n 's/^package wasi:graphics-context@\([^;]*\);/\1/p' graphics-context/graphics-context.wit)
if [[ ! "$VERSION" =~ ^0\.2\.0-rc\.[0-9]+$ ]]; then
echo "Error: Version '$VERSION' is not a valid RC version"
exit 1
fi
TAG="v${VERSION}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Publishing version: $VERSION"

- name: Check tag doesn't exist
run: |
if git tag -l "${{ steps.version.outputs.tag }}" | grep -q .; then
echo "Error: Tag ${{ steps.version.outputs.tag }} already exists"
exit 1
fi

- name: Create git tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.version.outputs.tag }}" -m "Release ${{ steps.version.outputs.version }}"
git push origin "${{ steps.version.outputs.tag }}"

- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.version }}" \
--prerelease \
--generate-notes

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@80aaafe04903087c333980fa2686259ddd34b2d9 # v1.16.6

- name: Install wkg
run: cargo binstall -y "wkg@0.15.0"

- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build WIT packages
run: |
for pkg in graphics-context webgpu surface frame-buffer; do
(cd "$pkg" && wkg wit build -d . -o "../wasi-${pkg}.wasm")
done

- name: Publish graphics-context
id: publish-graphics-context
uses: bytecodealliance/wkg-github-action@10b3b04b9059ba46208cd7daf7d352af14bded0f # v5
with:
oci-reference-without-tag: ghcr.io/webassembly/wasi/graphics-context
file: wasi-graphics-context.wasm
description: 'WASI Graphics Context'
source: https://github.com/WebAssembly/wasi-gfx
homepage: https://github.com/WebAssembly/wasi-gfx
version: ${{ steps.version.outputs.version }}
licenses: Apache-2.0 WITH LLVM-exception

- name: Publish webgpu
id: publish-webgpu
uses: bytecodealliance/wkg-github-action@10b3b04b9059ba46208cd7daf7d352af14bded0f # v5
with:
oci-reference-without-tag: ghcr.io/webassembly/wasi/webgpu
file: wasi-webgpu.wasm
description: 'WASI WebGPU'
source: https://github.com/WebAssembly/wasi-gfx
homepage: https://github.com/WebAssembly/wasi-gfx
version: ${{ steps.version.outputs.version }}
licenses: Apache-2.0 WITH LLVM-exception

- name: Publish surface
id: publish-surface
uses: bytecodealliance/wkg-github-action@10b3b04b9059ba46208cd7daf7d352af14bded0f # v5
with:
oci-reference-without-tag: ghcr.io/webassembly/wasi/surface
file: wasi-surface.wasm
description: 'WASI Surface'
source: https://github.com/WebAssembly/wasi-gfx
homepage: https://github.com/WebAssembly/wasi-gfx
version: ${{ steps.version.outputs.version }}
licenses: Apache-2.0 WITH LLVM-exception

- name: Publish frame-buffer
id: publish-frame-buffer
uses: bytecodealliance/wkg-github-action@10b3b04b9059ba46208cd7daf7d352af14bded0f # v5
with:
oci-reference-without-tag: ghcr.io/webassembly/wasi/frame-buffer
file: wasi-frame-buffer.wasm
description: 'WASI Frame Buffer'
source: https://github.com/WebAssembly/wasi-gfx
homepage: https://github.com/WebAssembly/wasi-gfx
version: ${{ steps.version.outputs.version }}
licenses: Apache-2.0 WITH LLVM-exception

- name: Attest build provenance
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-name: ghcr.io/webassembly/wasi/graphics-context
subject-digest: ${{ steps.publish-graphics-context.outputs.digest }}
push-to-registry: true

- name: Attest build provenance (webgpu)
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-name: ghcr.io/webassembly/wasi/webgpu
subject-digest: ${{ steps.publish-webgpu.outputs.digest }}
push-to-registry: true

- name: Attest build provenance (surface)
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-name: ghcr.io/webassembly/wasi/surface
subject-digest: ${{ steps.publish-surface.outputs.digest }}
push-to-registry: true

- name: Attest build provenance (frame-buffer)
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-name: ghcr.io/webassembly/wasi/frame-buffer
subject-digest: ${{ steps.publish-frame-buffer.outputs.digest }}
push-to-registry: true

- name: Upload wasm files to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ steps.version.outputs.tag }}" \
wasi-graphics-context.wasm \
wasi-webgpu.wasm \
wasi-surface.wasm \
wasi-frame-buffer.wasm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.wasm
18 changes: 0 additions & 18 deletions frame-buffer/deps/graphics-context/graphics-context.wit

This file was deleted.

4 changes: 2 additions & 2 deletions frame-buffer/frame-buffer.wit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package wasi:frame-buffer@0.0.1;
package wasi:frame-buffer@0.2.0-rc.1;

world imports {
import frame-buffer;
}

interface frame-buffer {
use wasi:graphics-context/graphics-context@0.0.1.{context, abstract-buffer};
use wasi:graphics-context/graphics-context@0.2.0-rc.1.{context, abstract-buffer};

resource device {
constructor();
Expand Down
4 changes: 4 additions & 0 deletions frame-buffer/wkg.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is automatically generated.
# It is not intended for manual editing.
version = 1
packages = []
2 changes: 2 additions & 0 deletions frame-buffer/wkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[overrides]
"wasi:graphics-context" = { path = "../graphics-context" }
2 changes: 1 addition & 1 deletion graphics-context/graphics-context.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:graphics-context@0.0.1;
package wasi:graphics-context@0.2.0-rc.1;

world imports {
import graphics-context;
Expand Down
4 changes: 4 additions & 0 deletions graphics-context/wkg.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is automatically generated.
# It is not intended for manual editing.
version = 1
packages = []
7 changes: 3 additions & 4 deletions install-wit-deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
wit-deps -m webgpu/deps.toml -l webgpu/deps.lock -d webgpu/deps update
wit-deps -m surface/deps.toml -l surface/deps.lock -d surface/deps update
wit-deps -m graphics-context/deps.toml -l graphics-context/deps.lock -d graphics-context/deps update
wit-deps -m frame-buffer/deps.toml -l frame-buffer/deps.lock -d frame-buffer/deps update
for pkg in graphics-context webgpu surface frame-buffer; do
(cd "$pkg" && wkg wit fetch -d .)
done
18 changes: 0 additions & 18 deletions surface/deps/graphics-context/graphics-context.wit

This file was deleted.

34 changes: 0 additions & 34 deletions surface/deps/io/error.wit

This file was deleted.

41 changes: 0 additions & 41 deletions surface/deps/io/poll.wit

This file was deleted.

Loading
Loading