2022-03-23 15:51:48 +01:00
|
|
|
name: Build debug apk
|
2022-02-14 00:42:41 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2022-03-23 10:23:13 +01:00
|
|
|
Make-apk:
|
2022-02-14 00:42:41 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install nix
|
|
|
|
uses: cachix/install-nix-action@v15
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2022-03-23 10:23:13 +01:00
|
|
|
- name: Setup nixbuild.net
|
2022-03-23 15:51:48 +01:00
|
|
|
uses: nixbuild/nixbuild-action@v9
|
2022-02-14 00:42:41 +01:00
|
|
|
with:
|
2022-03-23 10:23:13 +01:00
|
|
|
nixbuild_ssh_key: ${{ secrets.nixbuild_ssh_key }}
|
|
|
|
- name: Checkout repo
|
2022-02-14 00:42:41 +01:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cache debug certificate
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: _build/debug.keystore
|
|
|
|
key: debug-keystore
|
2022-03-23 10:23:13 +01:00
|
|
|
# Hopefully cached.
|
|
|
|
- name: Debug certificate
|
|
|
|
run: |
|
|
|
|
[[ -f _build/debug.keystore ]] ||
|
|
|
|
nix-shell ./shell.nix --run 'make debug.keystore'
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-03-23 15:51:48 +01:00
|
|
|
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
|
2022-03-23 10:23:13 +01:00
|
|
|
mkdir -p _build
|
2022-03-23 15:51:48 +01:00
|
|
|
cp $result/*.apk _build
|
2022-02-14 00:42:41 +01:00
|
|
|
- name: Save debug apk
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: debug apk
|
|
|
|
path: _build/*.apk
|