abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorJules Aguillon2022-03-24 18:42:44 +0100
committerJules Aguillon2022-03-24 18:43:09 +0100
commit0fb7150a0656c88abf278a3afd8021c1e6d2a04d (patch)
treef224dc8b89ca651961f2894d9623c62dba181daf
parentf3aa218de40a44eeaf1e7ec169bb2b3d4da526ad (diff)
downloadunexpected-keyboard-0fb7150a0656c88abf278a3afd8021c1e6d2a04d.tar.gz
unexpected-keyboard-0fb7150a0656c88abf278a3afd8021c1e6d2a04d.zip
Revert to the previous CI
The new CI script doesn't work on forks. This reverts commit f3aa218de40a44eeaf1e7ec169bb2b3d4da526ad. This reverts commit 3373c59b903cfcccedf31278f9f18ea305e3a567.
-rw-r--r--.github/workflows/make-apk.yml33
-rw-r--r--shell.nix32
2 files changed, 19 insertions, 46 deletions
diff --git a/.github/workflows/make-apk.yml b/.github/workflows/make-apk.yml
index 6b3c47a..2fe3534 100644
--- a/.github/workflows/make-apk.yml
+++ b/.github/workflows/make-apk.yml
@@ -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:
diff --git a/shell.nix b/shell.nix
index 1ee5012..8036a5e 100644
--- a/shell.nix
+++ b/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;
}