diff --git a/.circleci/config.yml b/.circleci/config.yml index b38179ea..3c51e6a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,6 +119,10 @@ jobs: command: | script/test script/run_lib_tests + - persist_to_workspace: + root: ./ + paths: + - bb - run: name: Release command: | @@ -144,7 +148,7 @@ jobs: GRAALVM_HOME: /home/circleci/graalvm-ce-java11-20.3.0 BABASHKA_PLATFORM: linux-static # used in release script BABASHKA_TEST_ENV: native - BABASHKA_STATIC: true + BABASHKA_STATIC: "true" BABASHKA_XMX: "-J-Xmx6500m" resource_class: large steps: @@ -303,6 +307,8 @@ jobs: - image: circleci/buildpack-deps:stretch steps: - checkout + - attach_workspace: + at: ./ - run: name: "Pull Submodules" command: | @@ -336,7 +342,4 @@ workflows: branches: only: master requires: - - jvm - linux - - linux-static - - mac diff --git a/.circleci/script/docker b/.circleci/script/docker index 3bb446b2..e361b576 100755 --- a/.circleci/script/docker +++ b/.circleci/script/docker @@ -17,7 +17,7 @@ fi if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then echo "Building Docker image $image_name:$image_tag" echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin - docker build -t "$image_name" --build-arg BABASHKA_XMX="-J-Xmx6300m" . + docker build -t "$image_name" -f Dockerfile.ci . docker tag "$image_name:$latest_tag" "$image_name:$image_tag" # we only update latest when it's not a SNAPSHOT version if [ "false" = "$snapshot" ]; then diff --git a/.github/script/docker b/.github/script/docker index 7a1a730d..55552deb 100755 --- a/.github/script/docker +++ b/.github/script/docker @@ -19,7 +19,7 @@ if [ -z "$GITHUB_HEAD_REF" ] && [ "${GITHUB_REF##*/}" = "master" ] then echo "Building Docker image $image_name:$image_tag" echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin - docker build -t "$image_name" --build-arg BABASHKA_XMX="-J-Xmx6300m" . + docker build -t "$image_name" -f Dockerfile.ci . docker tag "$image_name:$latest_tag" "$image_name:$image_tag" # we only update latest when it's not a SNAPSHOT version if [ "false" = "$snapshot" ]; then diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06f18d30..7950a76b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ name: build -on: [push - , pull_request - ] +on: + push: + branches: + - master jobs: @@ -30,7 +31,7 @@ jobs: with: fetch-depth: 1 submodules: 'true' - + - name: Cache deps uses: actions/cache@v1 id: cache-deps @@ -164,6 +165,13 @@ jobs: export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.3.0" BABASHKA_TEST_ENV=native script/test + - name: Save binary + uses: actions/upload-artifact@v2 + with: + name: bb-linux-binary + path: | + bb + - name: Install clojure run: | sudo script/install-clojure /usr/local @@ -263,7 +271,7 @@ jobs: mac: if: "!contains(github.event.head_commit.message, 'skip ci')" needs: [jvm] - runs-on: macOS-latest + runs-on: macos-latest steps: - name: Git checkout uses: actions/checkout@v1 @@ -358,7 +366,7 @@ jobs: docker: if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'" - needs: [jvm, linux, linux-static, mac] + needs: [linux] runs-on: ubuntu-18.04 steps: - name: Git checkout @@ -367,6 +375,12 @@ jobs: fetch-depth: 1 submodules: 'true' + - name: Download linux binary + uses: actions/download-artifact@v2 + with: + name: bb-linux-binary + path: bb + - name: Docker build env: DOCKERHUB_USER: "${{ secrets.DOCKERHUB_USER }}" diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 00000000..e81fa1f1 --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,9 @@ +FROM ubuntu:latest + +RUN apt-get update \ + && apt-get install -y curl \ + && mkdir -p /usr/local/bin + +COPY bb /usr/local/bin/bb + +CMD ["bb"]