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:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -6,40 +6,29 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Make-apk:
|
Build-Apk:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install nix
|
- name: Install nix
|
||||||
uses: cachix/install-nix-action@v15
|
uses: cachix/install-nix-action@v15
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- name: Setup nixbuild.net
|
- uses: cachix/cachix-action@v10
|
||||||
uses: nixbuild/nixbuild-action@v9
|
|
||||||
with:
|
with:
|
||||||
nixbuild_ssh_key: ${{ secrets.nixbuild_ssh_key }}
|
name: julow
|
||||||
- name: Checkout repo
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Cache debug certificate
|
- name: Cache debug certificate
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: _build/debug.keystore
|
path: _build/debug.keystore
|
||||||
key: debug-keystore
|
key: debug-keystore
|
||||||
# Hopefully cached.
|
- name: Run nix-shell and Make
|
||||||
- name: Debug certificate
|
uses: ZenithalHourlyRate/nix-shell-action@v4
|
||||||
run: |
|
with:
|
||||||
[[ -f _build/debug.keystore ]] ||
|
file: shell.nix
|
||||||
nix-shell ./shell.nix --run 'make debug.keystore'
|
script: make
|
||||||
- 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
|
- name: Save debug apk
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
32
shell.nix
32
shell.nix
@ -1,35 +1,19 @@
|
|||||||
{ pkgs ? import <nixpkgs> {
|
{ pkgs ? import <nixpkgs> {
|
||||||
config.android_sdk.accept_license = true;
|
config.android_sdk.accept_license = true;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
} }:
|
} }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
jdk = pkgs.openjdk8;
|
||||||
|
|
||||||
android = pkgs.androidenv.composeAndroidPackages {
|
android = pkgs.androidenv.composeAndroidPackages {
|
||||||
buildToolsVersions = [ "30.0.3" ];
|
buildToolsVersions = [ "30.0.3" ];
|
||||||
platformVersions = [ "30" ];
|
platformVersions = [ "30" ];
|
||||||
abiVersions = [ "armeabi-v7a" ];
|
abiVersions = [ "armeabi-v7a" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
in
|
||||||
[ pkgs.findutils pkgs.openjdk8 android.androidsdk pkgs.fontforge ];
|
pkgs.mkShell {
|
||||||
|
buildInputs = [ pkgs.findutils jdk android.androidsdk pkgs.fontforge ];
|
||||||
# Env variable required by the Makefile
|
|
||||||
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
|
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