blob: 5539cceda3575ca9f4d6a42ccca7ab0f12da5d81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  | 
version: 2.1
commands:
  setup-bazel:
    description: |
      Setup the Bazel build system used for building Android projects
    steps:
      - run:
          name: Add Bazel Apt repository
          command: |
            sudo apt install curl gnupg
            curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
            sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
            echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
      - run:
          name: Install Bazel from Apt
          command: sudo apt update && sudo apt install bazel
jobs:
  build:
    machine:
      image: 'ubuntu-2004:202010-01'
    steps:
      - checkout
      - setup-bazel
      - restore_cache:
          keys:
            - bazel-cache-{{ .Branch }}
      - run:
          name: "Build"
          command: "bazel build //:packages"
      - save_cache:
          paths:
            - ~/.cache/bazel
          key: bazel-cache-{{ .Branch }}
      - run:
          name: "Move artifacts"
          command: |
            mkdir ~/project/artifacts
            mv ~/project/bazel-bin/packages* ~/project/artifacts
      - store_artifacts:
          path: ~/project/artifacts
workflows:
  build-workflow:
    jobs:
      - build
  |