From fde9095587cea432997eb24c3a3f9c61737e2f1e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 29 May 2023 09:19:51 +0200 Subject: gitlab-ci --- .gitlab-ci.yml | 17 +++++++++++++++++ Readme.md | 3 +++ nix/android-composition.nix | 8 ++++---- shell.nix | 4 +++- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4a6b052 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +build: + stage: build + only: + - tags + + image: nixpkgs/nix + + before_script: + - export NIX_PATH=nixpkgs=channel:nixos-unstable + + script: + - nix-shell --command "make build" + - cp bazel-bin/app/java/dnsproxy.apk ${CI_PROJECT_DIR}/dnsproxy.apk + + artifacts: + paths: + - dnsproxy.apk diff --git a/Readme.md b/Readme.md index af3af6a..bebbbc1 100644 --- a/Readme.md +++ b/Readme.md @@ -36,3 +36,6 @@ ### APK - https://stackoverflow.com/questions/43513006/how-to-build-a-release-apk-with-signature-in-bazel - https://groups.google.com/g/bazel-discuss/c/2BPWVRnsiGc + +### Gitlab CI +- https://discourse.nixos.org/t/how-to-use-nix-develop-within-a-gitlab-ci-pipeline/24027 diff --git a/nix/android-composition.nix b/nix/android-composition.nix index 17c6e69..10ba2a5 100644 --- a/nix/android-composition.nix +++ b/nix/android-composition.nix @@ -7,8 +7,8 @@ androidenv.composeAndroidPackages { platformVersions = ["28" "30" "31"]; buildToolsVersions = ["30.0.3"]; - includeEmulator = true; - includeSystemImages = true; - systemImageTypes = ["google_apis_playstore"]; - abiVersions = ["x86_64"]; + # includeEmulator = true; + # includeSystemImages = true; + # systemImageTypes = ["google_apis_playstore"]; + # abiVersions = ["x86_64"]; } diff --git a/shell.nix b/shell.nix index 7017e08..d457038 100644 --- a/shell.nix +++ b/shell.nix @@ -7,6 +7,8 @@ mkShell rec { name = "android-shell"; buildInputs = [ + python3Full + gnumake jdk android-composition.androidsdk bazel_4 @@ -19,6 +21,6 @@ mkShell rec { shellHook = '' # TODO: replace with nix builtins - sudo python ./nix/android-shell-shellHook.py ${ANDROID_HOME}/build-tools ${ANDROID_HOME}/platforms + python ./nix/android-shell-shellHook.py ${ANDROID_HOME}/build-tools ${ANDROID_HOME}/platforms ''; } -- cgit v1.2.3