Skip to content

feat(web-host): add link to source of plugin, sanitizing plugin name #94

feat(web-host): add link to source of plugin, sanitizing plugin name

feat(web-host): add link to source of plugin, sanitizing plugin name #94

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=25.0" >> $GITHUB_ENV
echo "WASI_VERSION=25" >> $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
- name: Install cargo-component
run: cargo binstall cargo-component@0.21.1
- name: Install wasm-tools
run: cargo binstall wasm-tools@1.235.0
- name: Install wit-bindgen
run: cargo install wit-bindgen-cli@0.43.0
- 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
steps:
- 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: Release draft
uses: softprops/action-gh-release@v2
with:
draft: true
files: ./tmp/plugins/*.wasm