1- name : Publish a Wasm Component to GitHub Artifacts
1+ name : Build and publish a Wasm Component to GitHub Artifacts
22
33on :
44 push :
99env :
1010 IMAGE_NAME : ${{ github.repository }}
1111 COMPONENT_NAME : rust-wasi-hello
12+ CARGO_COMPONENT_VERSION : " 0.16.0"
1213
1314jobs :
1415 publish :
@@ -21,13 +22,15 @@ jobs:
2122 steps :
2223 - name : Checkout repository
2324 uses : actions/checkout@v2
25+
2426 - name : Docker meta
2527 id : meta
2628 uses : docker/metadata-action@v5
2729 with :
2830 images : ghcr.io/${{ github.actor }}/{{ env.COMPONENT_NAME }}
2931 tags : |
3032 type=semver,pattern={{version}}
33+
3134 - name : Login to GitHub Container Registry
3235 uses : docker/login-action@v3
3336 with :
@@ -52,12 +55,14 @@ jobs:
5255 ${{ runner.os }}-
5356
5457 - if : ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
55- name : Run install script
58+ name : Install build dependencies
5659 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
5863
59- - name : Run build script
60- run : bash scripts/ build.sh
64+ - name : Build the component
65+ run : cargo component build --release
6166
6267 - name : Publish to GitHub Container Registry
6368 id : publish
0 commit comments