abouttreesummaryrefslogcommitdiff
path: root/.github/workflows/make-apk.yml
blob: 6b3c47ad9483b9f2ac3025a1e6e28e7e6dafec7c (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
name: Build debug apk

on:
  workflow_dispatch:
  push:
  pull_request:

jobs:
  Make-apk:
    runs-on: ubuntu-latest
    steps:
    - name: Install nix
      uses: cachix/install-nix-action@v15
      with:
        nix_path: nixpkgs=channel:nixos-unstable
    - name: Setup nixbuild.net
      uses: nixbuild/nixbuild-action@v9
      with:
        nixbuild_ssh_key: ${{ secrets.nixbuild_ssh_key }}
    - name: Checkout repo
      uses: actions/checkout@v2
    - name: Cache debug certificate
      uses: actions/cache@v2
      with:
        path: _build/debug.keystore
        key: debug-keystore
    # Hopefully cached.
    - name: Debug certificate
      run: |
        [[ -f _build/debug.keystore ]] ||
        nix-shell ./shell.nix --run 'make debug.keystore'
    - name: Build
      run: |
        store=ssh-ng://eu.nixbuild.net
        result=$(
          nix build --json --eval-store auto --store $store \
            -f ./shell.nix debug-apk \
          | jq -r '.[0].outputs.out'
        )
        nix copy --from $store $result
        mkdir -p _build
        cp $result/*.apk _build
    - name: Save debug apk
      uses: actions/upload-artifact@v2
      with:
        name: debug apk
        path: _build/*.apk