Release wasmedge-sdk crate #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release wasmedge-sdk crate | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
inputs: | |
wasmedge_version: | |
description: "Version of WasmEdge" | |
required: true | |
type: string | |
jobs: | |
release_wasmedge_sdk: | |
name: Release wasmedge-sdk 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 | |
- 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: Install WasmEdge | |
run: | | |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v ${{ inputs.wasmedge_version }} -p /usr/local | |
ldconfig | |
- name: Install Rust-nightly | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Dry run cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRIES_SDK_TOKEN }} | |
shell: bash | |
run: | | |
cargo publish --dry-run -p wasmedge-sdk | |
- name: Publish | |
if: github.ref == 'refs/heads/main' | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRIES_SDK_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | | |
cargo publish -p wasmedge-sdk | |
- name: Build API document | |
run: | | |
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc -p wasmedge-sdk --workspace --no-deps --features aot,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: target/doc | |
force_orphan: true |