forked from extern/Unexpected-Keyboard
Revert to the previous CI
The new CI script doesn't work on forks. This reverts commitf3aa218de4
. This reverts commit3373c59b90
.
This commit is contained in:
parent
f3aa218de4
commit
0fb7150a06
33
.github/workflows/make-apk.yml
vendored
33
.github/workflows/make-apk.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Build debug apk
|
||||
name: Make Apk CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@ -6,40 +6,29 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
Make-apk:
|
||||
Build-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
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
nixbuild_ssh_key: ${{ secrets.nixbuild_ssh_key }}
|
||||
- name: Checkout repo
|
||||
name: julow
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_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: Run nix-shell and Make
|
||||
uses: ZenithalHourlyRate/nix-shell-action@v4
|
||||
with:
|
||||
file: shell.nix
|
||||
script: make
|
||||
- name: Save debug apk
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
32
shell.nix
32
shell.nix
@ -1,35 +1,19 @@
|
||||
{ pkgs ? import <nixpkgs> {
|
||||
config.android_sdk.accept_license = true;
|
||||
config.allowUnfree = true;
|
||||
} }:
|
||||
config.android_sdk.accept_license = true;
|
||||
config.allowUnfree = true;
|
||||
} }:
|
||||
|
||||
let
|
||||
jdk = pkgs.openjdk8;
|
||||
|
||||
android = pkgs.androidenv.composeAndroidPackages {
|
||||
buildToolsVersions = [ "30.0.3" ];
|
||||
platformVersions = [ "30" ];
|
||||
abiVersions = [ "armeabi-v7a" ];
|
||||
};
|
||||
|
||||
buildInputs =
|
||||
[ pkgs.findutils pkgs.openjdk8 android.androidsdk pkgs.fontforge ];
|
||||
|
||||
# Env variable required by the Makefile
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [ pkgs.findutils jdk android.androidsdk pkgs.fontforge ];
|
||||
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
|
||||
|
||||
# Build the debug APK. Exposed as an attribute, used in CI
|
||||
debug-apk = pkgs.stdenv.mkDerivation {
|
||||
name = "unexpected-keyboard-debug";
|
||||
src = ./.;
|
||||
inherit buildInputs ANDROID_HOME;
|
||||
buildPhase = ''
|
||||
make
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
mv _build/*.apk $out
|
||||
'';
|
||||
};
|
||||
|
||||
in pkgs.mkShell { inherit buildInputs ANDROID_HOME; } // {
|
||||
inherit debug-apk;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user