diff options
author | Dylan Arbour <[email protected]> | 2022-05-06 18:02:19 -0400 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-05-23 08:50:38 +0200 |
commit | b52310fed2629a9001640cfaf697bcb5bbaeb3c1 (patch) | |
tree | 904d6efb0fa354f9abed0d925b563ab4e1b8a504 /.github | |
parent | 046070074df6f23da3b29134dd0398c91a41fe90 (diff) | |
download | tinygo-b52310fed2629a9001640cfaf697bcb5bbaeb3c1.tar.gz tinygo-b52310fed2629a9001640cfaf697bcb5bbaeb3c1.zip |
ci: Add arm64 build
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/linux.yml | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 114959b0a..6e9868f61 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -346,3 +346,103 @@ jobs: path: | /tmp/tinygo.linux-arm.tar.gz /tmp/tinygo_armhf.deb + build-linux-arm64: + # Build ARM64 Linux binaries, ready for release. + # It is set to "needs: build-linux" because it modifies the release created + # in that process to avoid doing lots of duplicate work and to avoid + # complications around precompiled libraries such as compiler-rt shipped as + # part of the release tarball. + runs-on: ubuntu-18.04 + needs: build-linux + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install apt dependencies + run: | + sudo apt-get install --no-install-recommends \ + qemu-user \ + g++-aarch64-linux-gnu \ + libc6-dev-arm64-cross \ + ninja-build + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '1.18.1' + - name: Cache Go + uses: actions/cache@v2 + with: + key: go-cache-linux-arm64-v2-${{ hashFiles('go.mod') }} + path: | + ~/.cache/go-build + ~/go/pkg/mod + - name: Cache LLVM source + uses: actions/cache@v2 + id: cache-llvm-source + with: + key: llvm-source-14-linux-v1 + path: | + llvm-project/clang/lib/Headers + llvm-project/clang/include + llvm-project/compiler-rt + llvm-project/lld/include + llvm-project/llvm/include + - name: Download LLVM source + if: steps.cache-llvm-source.outputs.cache-hit != 'true' + run: make llvm-source + - name: Cache LLVM build + uses: actions/cache@v2 + id: cache-llvm-build + with: + key: llvm-build-14-linux-arm64-v1 + path: llvm-build + - name: Build LLVM + if: steps.cache-llvm-build.outputs.cache-hit != 'true' + run: | + # fetch LLVM source + rm -rf llvm-project + make llvm-source + # build! + make llvm-build CROSS=aarch64-linux-gnu + # Remove unnecessary object files (to reduce cache size). + find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \; + - name: Cache Binaryen + uses: actions/cache@v2 + id: cache-binaryen + with: + key: binaryen-linux-arm64-v1 + path: build/wasm-opt + - name: Build Binaryen + if: steps.cache-binaryen.outputs.cache-hit != 'true' + run: | + git submodule update --init lib/binaryen + make CROSS=aarch64-linux-gnu binaryen + - name: Install fpm + run: | + sudo gem install --no-document fpm + - name: Build TinyGo binary + run: | + make CROSS=aarch64-linux-gnu + - name: Download amd64 release + uses: actions/download-artifact@v2 + with: + name: linux-amd64-double-zipped + - name: Extract amd64 release + run: | + mkdir -p build/release + tar -xf tinygo.linux-amd64.tar.gz -C build/release tinygo + - name: Modify release + run: | + cp -p build/tinygo build/release/tinygo/bin + cp -p build/wasm-opt build/release/tinygo/bin + - name: Create arm64 release + run: | + make release deb RELEASEONLY=1 DEB_ARCH=arm64 + cp -p build/release.tar.gz /tmp/tinygo.linux-arm64.tar.gz + cp -p build/release.deb /tmp/tinygo_arm64.deb + - name: Publish release artifact + uses: actions/upload-artifact@v2 + with: + name: linux-arm64-double-zipped + path: | + /tmp/tinygo.linux-arm64.tar.gz + /tmp/tinygo_arm64.deb |