|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + linux: |
| 10 | + name: linux-${{ matrix.arch }} |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + arch: |
| 16 | + - amd64 |
| 17 | + - arm64 |
| 18 | + steps: |
| 19 | + |
| 20 | + - name: checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: install-deps |
| 24 | + run: | |
| 25 | + sudo apt update |
| 26 | + sudo apt install -y \ |
| 27 | + qemu-user-static |
| 28 | +
|
| 29 | + - name: build-image |
| 30 | + run: | |
| 31 | + pushd "$(mktemp -d)" |
| 32 | + curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1 |
| 33 | + podman build \ |
| 34 | + --arch ${{ matrix.arch }} \ |
| 35 | + --network host \ |
| 36 | + --pull \ |
| 37 | + --squash \ |
| 38 | + --tag rust:alpine-mimalloc \ |
| 39 | + . |
| 40 | + popd |
| 41 | +
|
| 42 | + - name: build |
| 43 | + run: | |
| 44 | + podman run \ |
| 45 | + --arch ${{ matrix.arch }} \ |
| 46 | + --init \ |
| 47 | + --network host \ |
| 48 | + --rm \ |
| 49 | + --tmpfs /tmp:exec \ |
| 50 | + --volume $PWD:/workspace \ |
| 51 | + --workdir /workspace \ |
| 52 | + rust:alpine-mimalloc \ |
| 53 | + ./build.sh |
| 54 | +
|
| 55 | + MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version |
| 56 | + MIMALLOC_VERBOSE=1 ./bin/wasmtime --version |
| 57 | + MIMALLOC_VERBOSE=1 ./bin/wizer --version |
| 58 | +
|
| 59 | + file ./bin/wasm-tools |
| 60 | + file ./bin/wasmtime |
| 61 | + file ./bin/wizer |
| 62 | +
|
| 63 | + mkdir wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }} |
| 64 | + mv bin wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }} |
| 65 | + tar \ |
| 66 | + --sort=name \ |
| 67 | + --mtime=1970-01-01T00:00:00Z \ |
| 68 | + --owner=0 --group=0 --numeric-owner \ |
| 69 | + --use-compress-program="zstd --ultra -22 --threads=0" \ |
| 70 | + -cf wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }}.tar.zst \ |
| 71 | + wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }} |
| 72 | +
|
| 73 | + - name: upload-artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }} |
| 77 | + path: wasm-tools-${{ github.ref_name }}-linux-${{ matrix.arch }}.tar.zst |
| 78 | + |
| 79 | + darwin: |
| 80 | + name: darwin-${{ matrix.arch }} |
| 81 | + runs-on: macos-latest |
| 82 | + strategy: |
| 83 | + fail-fast: false |
| 84 | + matrix: |
| 85 | + arch: |
| 86 | + - x86_64 |
| 87 | + - aarch64 |
| 88 | + steps: |
| 89 | + |
| 90 | + - name: checkout |
| 91 | + uses: actions/checkout@v4 |
| 92 | + |
| 93 | + - name: install-deps |
| 94 | + run: | |
| 95 | + rustup target add ${{ matrix.arch }}-apple-darwin |
| 96 | +
|
| 97 | + - name: build |
| 98 | + run: | |
| 99 | + ./build.sh --target ${{ matrix.arch }}-apple-darwin |
| 100 | +
|
| 101 | + file ./bin/wasm-tools |
| 102 | + file ./bin/wasmtime |
| 103 | + file ./bin/wizer |
| 104 | +
|
| 105 | + mkdir wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }} |
| 106 | + mv bin wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }} |
| 107 | + gtar \ |
| 108 | + --sort=name \ |
| 109 | + --mtime=1970-01-01T00:00:00Z \ |
| 110 | + --owner=0 --group=0 --numeric-owner \ |
| 111 | + --use-compress-program="zstd --ultra -22 --threads=0" \ |
| 112 | + -cf wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst \ |
| 113 | + wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }} |
| 114 | +
|
| 115 | + - name: upload-artifact |
| 116 | + uses: actions/upload-artifact@v4 |
| 117 | + with: |
| 118 | + name: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }} |
| 119 | + path: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst |
0 commit comments