1
1
name : Publish a Wasm Component package to GitHub Artifacts
2
2
3
+ # Run this action whenever a new release is tagged
3
4
on :
4
5
push :
5
6
tags :
@@ -14,26 +15,43 @@ jobs:
14
15
runs-on : ubuntu-latest
15
16
16
17
steps :
18
+ # Checkout the repo and install dependencies
17
19
- name : Checkout repository
18
20
uses : actions/checkout@v2
19
- - name : Docker meta
21
+ - name : Install cargo-binstall
22
+ uses :
cargo-bins/[email protected]
23
+ - name : Install wkg
24
+ shell : bash
25
+ run : cargo binstall wkg
26
+
27
+ # To version our image we want to obtain the version from the tag
28
+ - name : Get version
20
29
id : meta
21
30
uses : docker/metadata-action@v5
22
31
with :
23
32
images : ghcr.io/WebAssembly/wasi/io
24
33
tags : |
25
34
type=semver,pattern={{version}}
26
- - name : Login to GitHub Container Registry
35
+
36
+ # To upload our image to the GitHub registry, we first have to login
37
+ - name : Login to the GitHub registry
27
38
uses : docker/login-action@v3
28
39
with :
29
40
registry : ghcr.io
30
41
username : ${{ github.actor }}
31
42
password : ${{ secrets.GITHUB_TOKEN }}
43
+
44
+ # Build our `.wit` files into a Wasm binary
45
+ - name : Build
46
+ shell : bash
47
+ run : wkg wit build -o wasi-io.wasm
32
48
33
- - uses : bytecodealliance/wkg-github-action@v1
49
+ # Upload the Wasm binary to the GitHub registry
50
+ - uses : bytecodealliance/wkg-github-action@v2
34
51
with :
35
- description : ' A WASI API providing I/O stream abstractions.'
36
52
oci-reference-without-tag : ' ghcr.io/WebAssembly/wasi/io'
53
+ file : ' wasi-io.wasm'
54
+ description : ' A WASI API providing I/O stream abstractions.'
37
55
source : ' https://github.com/webassembly/wasi'
38
56
homepage : ' https://wasi.dev'
39
57
version : ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
0 commit comments