Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/publish-wit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish WIT to registry

on:
workflow_dispatch:

jobs:
publish-wit:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall

- name: Install wasm-tools
shell: bash
run: cargo binstall wasm-tools

- name: Install wkg
shell: bash
run: cargo binstall wkg

- name: Login to the GitHub registry
uses: docker/login-action
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_PAT }}

- name: Build and publish WIT package
shell: bash
run: ./scripts/build-and-publish-wit.sh

11 changes: 11 additions & 0 deletions scripts/build-and-publish-wit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# This script builds and publishes the spin:up WIT package
# NOTE: The package name and version are inferred from the
# encoded wasm binary.
set -euo pipefail

# Build the package
wasm-tools component wit wit/ -w -o spin_up_wit.wasm

# Publish to registry
wkg publish --registry spinframework.dev spin_up_wit.wasm