1
- name : Publish a Wasm Component to GitHub Artifacts
1
+ name : Build and publish a Wasm Component to GitHub Artifacts
2
2
3
3
on :
4
4
push :
9
9
env :
10
10
IMAGE_NAME : ${{ github.repository }}
11
11
COMPONENT_NAME : rust-wasi-hello
12
+ CARGO_COMPONENT_VERSION : " 0.16.0"
12
13
13
14
jobs :
14
15
publish :
@@ -21,13 +22,15 @@ jobs:
21
22
steps :
22
23
- name : Checkout repository
23
24
uses : actions/checkout@v2
25
+
24
26
- name : Docker meta
25
27
id : meta
26
28
uses : docker/metadata-action@v5
27
29
with :
28
30
images : ghcr.io/${{ github.actor }}/{{ env.COMPONENT_NAME }}
29
31
tags : |
30
32
type=semver,pattern={{version}}
33
+
31
34
- name : Login to GitHub Container Registry
32
35
uses : docker/login-action@v3
33
36
with :
@@ -52,12 +55,14 @@ jobs:
52
55
${{ runner.os }}-
53
56
54
57
- if : ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
55
- name : Run install script
58
+ name : Install build dependencies
56
59
continue-on-error : false
57
- run : bash scripts/install.sh
60
+ run : |
61
+ cargo install cargo-component --force --version {{ env.CARGO_COMPONENT_VERSION }}
62
+ cargo install wkg --force
58
63
59
- - name : Run build script
60
- run : bash scripts/ build.sh
64
+ - name : Build the component
65
+ run : cargo component build --release
61
66
62
67
- name : Publish to GitHub Container Registry
63
68
id : publish
0 commit comments