From 6c8f9a10385cf714171b694f4fa9c0aaa5ccf46b Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 15 Mar 2021 16:56:32 +0100 Subject: [PATCH] [#241] AArch64 linux binaries --- .circleci/config.yml | 90 ++++++++++++++++++++++++++++++++++++++++ .circleci/script/release | 4 +- 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5aeb3fe7..1e9752a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -225,6 +225,95 @@ jobs: name: Publish artifact link to Slack command: | ./bb .circleci/script/publish_artifact.clj || true + linux-aarch64: + machine: + enabled: true + image: ubuntu-2004:202101-01 + resource_class: arm.large + working_directory: ~/repo + environment: + LEIN_ROOT: "true" + GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.0.0 + BABASHKA_PLATFORM: linux # used in release script + BABASHKA_ARCH: aarch64 + BABASHKA_TEST_ENV: native + BABASHKA_XMX: "-J-Xmx6500m" + steps: + - checkout + - run: + name: "Pull Submodules" + command: | + git submodule init + git submodule update + - run: + name: "Short circuit on SNAPSHOT" + command: | + VERSION=$(cat resources/BABASHKA_VERSION) + if [[ "$VERSION" == *-SNAPSHOT ]] + then + circleci task halt + fi + - restore_cache: + keys: + - linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} + - run: + name: Install Leiningen + command: | + sudo script/install-leiningen + - run: + name: Install Clojure + command: | + wget https://download.clojure.org/install/linux-install-1.10.1.447.sh + chmod +x linux-install-1.10.1.447.sh + sudo ./linux-install-1.10.1.447.sh + - run: + name: Install lsof + command: | + sudo apt-get install lsof + - run: + name: Install native dev tools + command: | + sudo apt-get update + sudo apt-get -y install gcc g++ zlib1g-dev + - run: + name: Download GraalVM + command: | + cd ~ + if ! [ -d graalvm-ce-java11-21.0.0 ]; then + curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.0.0/graalvm-ce-java11-linux-aarch64-21.0.0.tar.gz + tar xzf graalvm-ce-java11-linux-aarch64-21.0.0.tar.gz + fi + - run: + name: Build binary + command: | + script/uberjar + script/compile + no_output_timeout: 30m + - run: + name: Run tests + command: | + script/test + script/run_lib_tests + - run: + name: Release + command: | + .circleci/script/release + - persist_to_workspace: + root: /tmp + paths: + - release + - save_cache: + paths: + - ~/.m2 + - ~/graalvm-ce-java11-21.0.0 + key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} + - store_artifacts: + path: /tmp/release + destination: release + - run: + name: Publish artifact link to Slack + command: | + ./bb .circleci/script/publish_artifact.clj || true mac: macos: xcode: "12.0.0" @@ -336,6 +425,7 @@ workflows: - linux - linux-static - mac + - linux-aarch64 - deploy: filters: branches: diff --git a/.circleci/script/release b/.circleci/script/release index a9edaeff..557006e4 100755 --- a/.circleci/script/release +++ b/.circleci/script/release @@ -13,7 +13,9 @@ mkdir -p /tmp/bb_size ## release binary as tar.gz archive -tar zcvf "babashka-$VERSION-$BABASHKA_PLATFORM-amd64.tar.gz" bb # bbk +arch=${BABASHKA_ARCH:amd64} + +tar zcvf "babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz" bb # bbk ## cleanup