Skip to content

240325

240325 #18

Workflow file for this run

name: build
on:
push:
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
linux:
name: linux-${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
sys: x86_64-linux
- arch: arm64/v8
sys: aarch64-linux
steps:
- name: setup-podman
uses: TerrorJack/setup-podman@master
- name: checkout
uses: actions/checkout@v4
- name: build-image
run: |
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
podman build \
--arch ${{ matrix.arch }} \
--network host \
--pull \
--squash-all \
--tag rust:alpine-mimalloc \
.
popd
- name: build
run: |
podman run \
--arch ${{ matrix.arch }} \
--env RUSTFLAGS="-C target-feature=+crt-static" \
--init \
--network host \
--rm \
--tmpfs /tmp:exec \
--volume $PWD:/workspace \
--workdir /workspace \
rust:alpine-mimalloc \
sh -c 'TARGET=$(rustc -vV | sed -n "s|host: ||p") && exec ./build.sh --target $TARGET'
MIMALLOC_VERBOSE=1 ./bin/wasm-component-ld --help
MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version
MIMALLOC_VERBOSE=1 ./bin/wasmtime --version
MIMALLOC_VERBOSE=1 ./bin/wit-bindgen --version
MIMALLOC_VERBOSE=1 ./bin/wizer --version
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
mkdir wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
mv bin wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
tar \
--sort=name \
--mtime=1970-01-01T00:00:00Z \
--owner=0 --group=0 --numeric-owner \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}.tar.zst \
wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
path: wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}.tar.zst
darwin:
name: darwin-${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
steps:
- name: checkout
uses: actions/checkout@v4
- name: install-deps
run: |
rustup target add ${{ matrix.arch }}-apple-darwin
- name: build
run: |
./build.sh --target ${{ matrix.arch }}-apple-darwin
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
mkdir wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
mv bin wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
gtar \
--sort=name \
--mtime=1970-01-01T00:00:00Z \
--owner=0 --group=0 --numeric-owner \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst \
wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
path: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst
windows:
name: windows-${{ matrix.arch }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
steps:
- name: checkout
uses: actions/checkout@v4
- name: install-deps
run: |
rustup target add ${{ matrix.arch }}-pc-windows-msvc
- name: build
run: |
mkdir wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}
cargo install `
--all-features `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
--git https://github.com/type-dance/wizer.git `
wizer
cargo install `
--all-features `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
wasm-component-ld wasm-tools wit-bindgen-cli wasmtime-cli
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}
path: wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}