forked from extern/Unexpected-Keyboard
The build takes place on the remote, which takes advantage of Nix's caching. The previous workflow used a remote cache but in order to build locally, all the dependencies needed to be downloaded from the cache everytime. The dependencies are 462M, downloading took most of the time.
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
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@v8
|
|
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: |
|
|
nix build --eval-store auto --store ssh-ng://eu.nixbuild.net \
|
|
-f ./shell.nix debug-apk
|
|
nix build -f ./shell.nix debug-apk
|
|
mkdir -p _build
|
|
cp result/*.apk _build
|
|
- name: Save debug apk
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: debug apk
|
|
path: _build/*.apk
|