Skip to content

docs: fix missing infos / typos #173

docs: fix missing infos / typos

docs: fix missing infos / typos #173

Workflow file for this run

name: rust-host
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Set variables based on OS and architecture for just dl-wasi-sdk
run: |
if [ "${{ runner.arch }}" = "X64" ]; then
echo "WASI_ARCH=x86_64" >> $GITHUB_ENV
else
echo "WASI_ARCH=arm64" >> $GITHUB_ENV
fi
if [ "${{ runner.os }}" = "Windows" ]; then
echo "WASI_OS=windows" >> $GITHUB_ENV
else
echo "WASI_OS=linux" >> $GITHUB_ENV
fi
echo "WASI_VERSION_FULL=27.0" >> $GITHUB_ENV
echo "WASI_VERSION=27" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- uses: cargo-bins/cargo-binstall@main
- uses: extractions/setup-just@v3
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Install TinyGo Compiler
run: |
if [ "${{ runner.arch }}" = "X64" ]; then
wget https://github.com/tinygo-org/tinygo/releases/download/v0.39.0/tinygo_0.39.0_amd64.deb
sudo dpkg -i tinygo_0.39.0_amd64.deb
else
wget https://github.com/tinygo-org/tinygo/releases/download/v0.39.0/tinygo_0.39.0_armhf.deb
sudo dpkg -i tinygo_0.39.0_armhf.deb
fi
export PATH=$PATH:/usr/local/bin
- name: Check TinyGo Compiler
run: tinygo version
- name: Install wkg
run: cargo binstall wkg
- name: Install cargo-component
run: cargo binstall [email protected]
- name: Install wasm-tools
run: cargo binstall [email protected]
- name: Install wit-bindgen
run: cargo install [email protected]
- name: Install wasi-sdk
run: |
mkdir c_deps
just dl-wasi-sdk
- name: Build
run: just build
- name: Test
run: just test
- name: Build plugins in release mode (for release-draft)
if: github.ref_type == 'tag'
run: just build-plugins-release
- name: Prepare wasm files (for release-draft)
if: github.ref_type == 'tag'
run: ./scripts/prepare-wasm-files.sh --mode release --target-dir ./tmp/plugins
- name: Cache wasm files (for release-draft)
if: github.ref_type == 'tag'
id: cache-wasm-files
uses: actions/cache@v4
with:
path: ./tmp/plugins
key: ${{ runner.os }}-wasm-files-${{ github.sha }}
release-draft:
if: github.ref_type == 'tag'
permissions:
contents: write
runs-on: ubuntu-latest
needs: build-and-test
env:
RELEASE_NAME: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Restore cached wasm files
id: cache-wasm-files-restore
uses: actions/cache/restore@v4
with:
path: ./tmp/plugins
key: ${{ runner.os }}-wasm-files-${{ github.sha }}
- name: Create release draft if it doesn't exist
uses: topheman/create-release-if-not-exist@v1
with:
args: ${{ env.RELEASE_NAME }} --draft --generate-notes
- name: Upload wasm files to release draft
run: |
gh release upload ${{ env.RELEASE_NAME }} ./tmp/plugins/*.wasm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}