-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (46 loc) · 1.68 KB
/
Copy pathbuild-rust.yml
File metadata and controls
53 lines (46 loc) · 1.68 KB
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 rust template
on:
push:
# Run for commits to main, but not for tags
branches:
- main
tags-ignore:
- '*'
paths:
- 'wasm-modules/templates/rust/**'
- '.github/workflows/build-rust.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/templates/rust
- name: Build Wasm module
working-directory: wasm-modules/templates/rust
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/templates/rust/target/wasm32-wasi/release/demo-mod.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/templates/rust/target/wasm32-wasi/release/demo-mod.wasm ghcr.io/shark/wasm-workflows-plugin-example-rust:latest