Skip to content

fix(types): Fixes validation for wasi:keyvalue #341

fix(types): Fixes validation for wasi:keyvalue

fix(types): Fixes validation for wasi:keyvalue #341

Workflow file for this run

name: Wadm Release
on:
push:
branches:
- main
tags:
- 'v*'
- 'types-v*'
- 'client-v*'
workflow_dispatch: # Allow manual creation of artifacts without a release
jobs:
build:
name: build release assets
runs-on: ${{ matrix.config.os }}
outputs:
version_output: ${{ steps.version_output.outputs.version }}
strategy:
matrix:
config:
# NOTE: We are building on an older version of ubuntu because of libc compatibility
# issues. Namely, if we build on a new version of libc, it isn't backwards compatible with
# old versions. But if we build on the old version, it is compatible with the newer
# versions running in ubuntu 22 and its ilk
- {
os: 'ubuntu-20.04',
arch: 'amd64',
extension: '',
targetPath: 'target/release/',
}
- {
os: 'ubuntu-20.04',
arch: 'aarch64',
extension: '',
targetPath: 'target/aarch64-unknown-linux-gnu/release/',
}
- {
os: 'macos-13',
arch: 'amd64',
extension: '',
targetPath: 'target/release/',
}
- {
os: 'windows-latest',
arch: 'amd64',
extension: '.exe',
targetPath: 'target/release/',
}
- {
os: 'macos-latest',
arch: 'aarch64',
extension: '',
targetPath: 'target/release/',
}
steps:
- uses: actions/checkout@v4
- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: set the release version (main)
if: github.ref == 'refs/heads/main'
shell: bash
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
- name: Output Version
id: version_output
run: echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
if: matrix.config.arch != 'aarch64' || startsWith(matrix.config.os, 'macos')
with:
toolchain: stable
components: clippy, rustfmt
- name: setup for cross-compile builds
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
rustup toolchain install stable-aarch64-unknown-linux-gnu
rustup target add --toolchain stable-aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
with:
toolchain: stable
components: clippy, rustfmt
target: aarch64-unknown-linux-gnu
- name: build release (amd64 linux, macos, windows)
if: matrix.config.arch != 'aarch64' || startsWith(matrix.config.os, 'macos')
run: 'cargo build --release --bin wadm'
- name: build release (arm64 linux)
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
run: 'cargo build --release --bin wadm --target aarch64-unknown-linux-gnu'
- uses: actions/upload-artifact@v4
with:
name: wadm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}
if-no-files-found: error
path: |
${{ matrix.config.targetPath }}wadm${{ matrix.config.extension }}
publish:
name: publish release assets
runs-on: ubuntu-20.04
needs: build
if: startsWith(github.ref, 'refs/tags/v')
env:
RELEASE_VERSION: ${{ needs.build.outputs.version_output }}
steps:
- name: download release assets
uses: actions/download-artifact@v4
- name: Generate Checksums
run: |
for dir in */; do
cd "$dir" || continue
sum=$(sha256sum * | awk '{ print $1 }')
echo "$dir:$sum" >> checksums-${{ env.RELEASE_VERSION }}.txt
cd ..
done
- name: Package Binaries
run: for dir in */; do tar -czvf "${dir%/}.tar.gz" "$dir"; done
- name: Create github release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
draft: false
files: |
checksums-${{ env.RELEASE_VERSION }}.txt
wadm-${{ env.RELEASE_VERSION }}-linux-aarch64.tar.gz
wadm-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz
wadm-${{ env.RELEASE_VERSION }}-macos-aarch64.tar.gz
wadm-${{ env.RELEASE_VERSION }}-macos-amd64.tar.gz
wadm-${{ env.RELEASE_VERSION }}-windows-amd64.tar.gz
crate:
name: Publish crate
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/types-v') || startsWith(github.ref, 'refs/tags/client-v')
needs: build
steps:
- uses: actions/checkout@v4
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cargo login
run: cargo login ${{ secrets.CRATES_TOKEN }}
shell: bash
- name: Cargo publish wadm-types
if: startsWith(github.ref, 'refs/tags/types-v')
run: cargo publish
working-directory: ./crates/wadm-types
shell: bash
- name: Cargo publish wadm lib
if: startsWith(github.ref, 'refs/tags/v')
run: cargo publish
working-directory: ./crates/wadm
shell: bash
- name: Cargo publish wadm-client
if: startsWith(github.ref, 'refs/tags/client-v')
run: cargo publish
working-directory: ./crates/wadm-client
shell: bash
docker-image:
name: Build and push docker images
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
env:
RELEASE_VERSION: ${{ needs.build.outputs.version_output }}
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/download-artifact@v4
with:
name: wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
path: ./artifacts
- run: mv ./artifacts/wadm ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64 && chmod +x ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
- uses: actions/download-artifact@v4
with:
name: wadm-${{ env.RELEASE_VERSION }}-linux-amd64
path: ./artifacts
- run: mv ./artifacts/wadm ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 && chmod +x ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: lowercase repository owner
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>$GITHUB_ENV
- name: Build and push (tag)
uses: docker/build-push-action@v6
if: startsWith(github.ref, 'refs/tags/v')
with:
push: true
platforms: linux/amd64,linux/arm64
context: ./
build-args: |
BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64
tags: ghcr.io/${{ env.OWNER }}/wadm:latest,ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION }}
- name: Build and push (main)
uses: docker/build-push-action@v6
if: github.ref == 'refs/heads/main'
with:
push: true
platforms: linux/amd64,linux/arm64
context: ./
build-args: |
BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64
tags: ghcr.io/${{ env.OWNER }}/wadm:canary