Skip to content

Release wasmedge-sys crate #4

Release wasmedge-sys crate

Release wasmedge-sys crate #4

name: wasmedge-sys-release
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on: workflow_dispatch
jobs:
release_wasmedge_sys:
name: Release wasmedge-sys crate
runs-on: ubuntu-22.04
container:
image: wasmedge/wasmedge:ubuntu-build-clang
steps:
- name: Checkout WasmEdge Rust SDK
uses: actions/checkout@v3
with:
fetch-depth: 0
path: wasmedge-rust-sdk
- name: Checkout WasmEdge Runtime
uses: actions/checkout@v3
with:
repository: WasmEdge/WasmEdge
path: WasmEdge
- name: Set up build environment
run: |
apt update
apt install -y software-properties-common libboost-all-dev ninja-build
apt install -y llvm-15-dev liblld-15-dev
- name: Build WasmEdge with Release mode
working-directory: WasmEdge
run: |
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_PROCESS=On .
cmake --build build
cmake --install build
ldconfig
- name: Install Rust v1.68
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.68
- name: Dry run cargo publish
working-directory: wasmedge-rust-sdk
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRIES_SYS_TOKEN }}
shell: bash
run: |
cargo publish --dry-run -p wasmedge-sys
- name: Publish
working-directory: wasmedge-rust-sdk
if: github.ref == 'refs/heads/main'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRIES_SYS_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
cargo publish -p wasmedge-sys
- name: Build API document
working-directory: wasmedge-rust-sdk
run: |
cargo doc -p wasmedge-sys --workspace --no-deps --features aot,async,wasi_crypto,wasi_nn,wasmedge_process,ffi --target-dir=./target
- name: Deploy API document
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: wasmedge-rust-sdk/target/doc
force_orphan: true