-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.74 KB
/
build-ferris-says.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build ferris-says example
on:
push:
# Run for commits to main, but not for tags
branches:
- main
tags-ignore:
- '*'
paths:
- 'wasm-modules/examples/ferris-says/**'
- '.github/workflows/build-ferris-says.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@f8f67b7515e98e4ac991ccb5c11240861e0f712b # https://github.com/Swatinem/rust-cache/tree/v1
with:
working-directory: wasm-modules/examples/ferris-says
- name: Build Wasm module
working-directory: wasm-modules/examples/ferris-says
run: |
cargo install cargo-wasi
cargo wasi build --release
- name: Upload Wasm module as artifact
uses: actions/upload-artifact@v3
with:
name: wasm-module
path: wasm-modules/examples/ferris-says/target/wasm32-wasi/release/ferris-says.wasm
retention-days: 7
- name: Install wasm-to-oci
run: |
sudo curl -sSL -o /usr/local/bin/wasm-to-oci https://github.com/engineerd/wasm-to-oci/releases/download/v0.1.2/linux-amd64-wasm-to-oci
sudo chmod +x /usr/local/bin/wasm-to-oci
- name: Log in to the Container registry
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # https://github.com/docker/login-action/tree/v1.14.1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push wasm module to ghcr.io
run: wasm-to-oci push wasm-modules/examples/ferris-says/target/wasm32-wasi/release/ferris-says.wasm ghcr.io/shark/wasm-workflows-plugin-example-ferris-says:latest