Skip to content

Commit

Permalink
Github Actions: add linux-aarch64 release build
Browse files Browse the repository at this point in the history
  • Loading branch information
epilys committed Apr 29, 2022
1 parent 3cb420f commit 6bd1ac8
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 68 deletions.
12 changes: 12 additions & 0 deletions .github/cross-linux-aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM rust:1
#FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge

# set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container
ENV CROSS_DOCKER_IN_DOCKER=true

RUN cargo install cross
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install -qy curl && \
curl -sSL https://get.docker.com/ | sh && \
apt-get install --assume-yes libxkbcommon0:arm64 libwayland-cursor0:arm64 libxkbcommon-dev:arm64 libwayland-dev:arm64 libxkbcommon-x11-dev:arm64
75 changes: 75 additions & 0 deletions .github/workflows/build_linux_aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
on: [push]

name: linux-aarch64 build

jobs:
linux_aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-linux-gnu
override: true
- name: Build cross image
run: |
#cargo install cross
docker build -t wasmer/aarch64 /home/runner/work/wasmer/wasmer/.github/cross-linux-aarch64/
#cat << EOF > ./Cross.toml
#[target.aarch64-unknown-linux-gnu]
#image = "wasmer/aarch64"
#EOF
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Install LLVM
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -yq tree
curl --proto '=https' --tlsv1.2 -sSf "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz" -L -o llvm.tar.xz
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
mkdir ${LLVM_DIR}
tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR}
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
- name: Build Wasmer binary
run: |
make build-wasmer
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /home/runner/work/wasmer/wasmer:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: --target aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
- name: Build C API
run: |
make build-capi
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /home/runner/work/wasmer/wasmer:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: --target aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
- name: Dist
run: |
#tree target/
make distribution
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /home/runner/work/wasmer/wasmer:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: --target aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
TARGET: aarch64-unknown-linux-gnu
TARGET_DIR: target/aarch64-unknown-linux-gnu/release
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: wasmer.tar.gz
path: dist
if-no-files-found: error
retention-days: 1
18 changes: 1 addition & 17 deletions .github/workflows/test-sys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo ::set-output name=VERSION::${VERSION}
DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true)
DOING_RELEASE=1 #$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true)
echo ::set-output name=DOING_RELEASE::${DOING_RELEASE}
echo $VERSION
echo $DOING_RELEASE
Expand Down Expand Up @@ -76,13 +76,6 @@ jobs:
use_sccache: true
run_test: true
run_test_capi: false # We can't run yet the capi tests on Windows
#- build: linux-aarch64
# os: [self-hosted, linux, ARM64]
# random_sccache_port: true
# use_sccache: true
# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/linux-aarch64.tar.gz'
# artifact_name: 'wasmer-linux-aarch64'
# run_integration_tests: false
- build: linux-musl-x64
os: ubuntu-latest
container: alpine:latest
Expand Down Expand Up @@ -438,15 +431,6 @@ jobs:
asset_path: artifacts/wasmer-darwin-arm64/wasmer.tar.gz
asset_name: wasmer-darwin-arm64.tar.gz
asset_content_type: application/gzip
#- name: Upload Release Asset Linux aarch64
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
# asset_name: wasmer-linux-aarch64.tar.gz
# asset_content_type: application/gzip

audit:
name: Audit
Expand Down
Loading

0 comments on commit 6bd1ac8

Please sign in to comment.