Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 2c96f4d

Browse files
authored
Upload a release artifact from CI (#15)
This updates CI to upload a `wasi_snapshot_preview1.wasm` release artifact from CI. One is stored per CI job in case it needs to be inspected, and additionally a github action is used to maintain a "latest" release for pushes to `main` to ensure that the latest copy of `wasi_snapshot_preview1.wasm` is available. I haven't thought much about official releases or tags or things like that but figured that this was a good starting place at least.
1 parent 45bc253 commit 2c96f4d

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
# Check Code style quickly by running `rustfmt` over all code
1417
rustfmt:
@@ -27,8 +30,39 @@ jobs:
2730
- uses: actions/checkout@v3
2831
- run: rustup update stable && rustup default stable
2932
- run: rustup target add wasm32-wasi
30-
- run: RUSTFLAGS="-Clink-args=--import-memory" cargo build --target wasm32-wasi
33+
- run: cargo build --target wasm32-wasi
34+
env:
35+
RUSTFLAGS: -Clink-args=--import-memory -Ctarget-feature=+bulk-memory -Clink-args=-zstack-size=0
3136
- run: cargo run -p verify -- ./target/wasm32-wasi/debug/wasi_snapshot_preview1.wasm
32-
- run: RUSTFLAGS="-Clink-args=--import-memory" cargo build --release --target wasm32-wasi
37+
- run: cargo build --release --target wasm32-wasi
38+
env:
39+
RUSTFLAGS: -Clink-args=--import-memory -Ctarget-feature=+bulk-memory -Clink-args=-zstack-size=0
3340
- run: cargo run -p verify -- ./target/wasm32-wasi/release/wasi_snapshot_preview1.wasm
3441
- run: cargo test -p host
42+
43+
build:
44+
name: Build
45+
runs-on: ubuntu-latest
46+
permissions:
47+
deployments: write
48+
contents: write
49+
steps:
50+
- uses: actions/checkout@v3
51+
- run: rustup update stable && rustup default stable
52+
- run: rustup target add wasm32-wasi
53+
- run: cargo build --target wasm32-wasi --release
54+
env:
55+
RUSTFLAGS: -Clink-args=--import-memory -Ctarget-feature=+bulk-memory -Clink-args=-zstack-size=0
56+
- uses: actions/upload-artifact@v3
57+
with:
58+
name: wasi_snapshot_preview1.wasm
59+
path: target/wasm32-wasi/release/wasi_snapshot_preview1.wasm
60+
61+
- uses: marvinpinto/action-automatic-releases@latest
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63+
with:
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
65+
automatic_release_tag: latest
66+
prerelease: true
67+
title: "Latest Build"
68+
files: target/wasm32-wasi/release/wasi_snapshot_preview1.wasm

test-programs/macros/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ fn main() {
1616
.current_dir("../../")
1717
.arg("--target=wasm32-wasi")
1818
.env("CARGO_TARGET_DIR", &out_dir)
19-
.env("RUSTFLAGS", "-Clink-args=--import-memory")
19+
.env(
20+
"RUSTFLAGS",
21+
"-Clink-args=--import-memory -Clink-args=-zstack-size=0",
22+
)
2023
.env_remove("CARGO_ENCODED_RUSTFLAGS");
2124
let status = cmd.status().unwrap();
2225
assert!(status.success());

0 commit comments

Comments
 (0)