Skip to content

Commit ceaed3a

Browse files
Workflow for publishing spin:up WIT package (#3300)
Signed-off-by: Brian Hardock <[email protected]>
1 parent b827629 commit ceaed3a

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/publish-wit.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish WIT to registry
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish-wit:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
packages: write
12+
contents: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Install cargo-binstall
19+
uses: cargo-bins/cargo-binstall
20+
21+
- name: Install wasm-tools
22+
shell: bash
23+
run: cargo binstall wasm-tools
24+
25+
- name: Install wkg
26+
shell: bash
27+
run: cargo binstall wkg
28+
29+
- name: Login to the GitHub registry
30+
uses: docker/login-action
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.REGISTRY_PAT }}
35+
36+
- name: Build and publish WIT package
37+
shell: bash
38+
run: ./scripts/build-and-publish-wit.sh
39+

scripts/build-and-publish-wit.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# This script builds and publishes the spin:up WIT package
3+
# NOTE: The package name and version are inferred from the
4+
# encoded wasm binary.
5+
set -euo pipefail
6+
7+
# Build the package
8+
wasm-tools component wit wit/ -w -o spin_up_wit.wasm
9+
10+
# Publish to registry
11+
wkg publish --registry spinframework.dev spin_up_wit.wasm

0 commit comments

Comments
 (0)