Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Dec 28, 2023
1 parent 5e2cd39 commit 3fc3f61
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/wasmer-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: wasmer deploy
on:
push:
branches: "main"
paths-ignore:
- .gitignore
- LICENSE
- README.md
workflow_dispatch:
concurrency: ${{ github.workflow }}
jobs:
wasmer-deploy:
permissions:
contents: write
environment:
name: wasmer
url: https://jcbhmr-hello-world-rust-wasmer-app.wasmer.app/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wasmerio/setup-wasmer@v3
- run: rustup target add wasm32-wasi
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-wasix
- run: cargo wasix build --release
- run: wasmer deploy --publish-package
env:
WASMER_TOKEN: ${{ secrets.WASMER_TOKEN }}
- uses: actions4git/add-commit-push@v1
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hello-world-rust-wasmer-app"
version = "0.1.0"
version = "0.0.0"
edition = "2021"
publish = false

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,22 @@
![Rust](https://img.shields.io/static/v1?style=for-the-badge&message=Rust&color=000000&logo=Rust&logoColor=FFFFFF&label=)
![WebAssembly](https://img.shields.io/static/v1?style=for-the-badge&message=WebAssembly&color=654FF0&logo=WebAssembly&logoColor=FFFFFF&label=)

Make sure you have the `wasm32-wasi` Rust target installed. You'll also need the
[Wasmer CLI] and [`cargo-wasix`] installed.

Write the backend Rust code _as though_ it were a normal HTTP server. That HTTP
server will compile to WASIX which will then be started by Wasmer's app backend
and have the request forwarded to it. Then after an indeterminate amount of time
it will be killed and stop recieving additional requests.

Note that the version fields all mean **absolutely nothing** in this context. Each
time you run `wasmer deploy`, it will bump the version. That version isn't
exposed anywhere to the endpoint.

<!-- prettier-ignore-start -->
[0BSD licensed]: https://github.com/jcbhmr/hello-world-rust-wasmer-app/blob/main/LICENSE
[wasmer]: https://wasmer.io/
[axum]: https://github.com/tokio-rs/axum
[wasmer cli]: https://docs.wasmer.io/install
[`cargo-wasix`]: https://github.com/wasix-org/cargo-wasix
<!-- prettier-ignore-end -->
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
kind: wasmer.io/App.v0
name: jcbhmr-hello-world-rust-wasmer-app
package: jcbhmr/hello-world-rust-wasmer-app@0.1.1
package: jcbhmr/hello-world-rust-wasmer-app@1.0.1
app_id: da_LKN4IZtyUVyR
2 changes: 1 addition & 1 deletion wasmer.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jcbhmr/hello-world-rust-wasmer-app"
version = "0.1.1"
version = "1.0.1"
description = "🟪 \"Hello world!\" demo Wasmer HTTP server application"
license = "0BSD"
wasmer-extra-flags = "--net --enable-threads --enable-bulk-memory"
Expand Down

0 comments on commit 3fc3f61

Please sign in to comment.