From e898772746dcbd084bc2c9e0cca5ee37469fa547 Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sun, 17 Dec 2023 18:18:03 +0800 Subject: [PATCH 1/5] add aapt to bundletool image --- .drone.yml | 10 +++++----- .gitignore | 1 + docker/bundletool.nix | 13 +++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 docker/bundletool.nix diff --git a/.drone.yml b/.drone.yml index 6539b62c..af3dde6e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,10 +33,10 @@ steps: - cp /tmp/build/build/app/outputs/bundle/release/* build/app/outputs/bundle/release/ - ls build/app/outputs/flutter-apk/ - ls build/app/outputs/bundle/release/ - when: - event: tag +# when: +# event: tag - name: Accrescent APKs - image: nixos/nix + image: gonzague/bundletool environment: ANDROID_KEY_FILE: /tmp/key.properties SERVER_URL: @@ -49,8 +49,8 @@ steps: - . /tmp/key.properties - cd build/app/outputs/bundle/release/ - bundletool build-apks --bundle=app-release.aab --output=app-release.apks --ks-pass=pass:$${storePassword} --ks=/tmp/keystore.jks --ks-key-alias=upload --key-pass=pass:$${keyPassword} - when: - event: tag +# when: +# event: tag - name: Publish image: plugins/github-release settings: diff --git a/.gitignore b/.gitignore index 24476c5d..27348c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release +/docker/result diff --git a/docker/bundletool.nix b/docker/bundletool.nix new file mode 100644 index 00000000..30e15b34 --- /dev/null +++ b/docker/bundletool.nix @@ -0,0 +1,13 @@ +# usage: +# build the image +# nix-build -o result bundletool.nix +# docker load -i result +# use the image as usual with name gonzague/bundletool +{ + pkgs ? import {system = "x86_64-linux";} +}: +pkgs.dockerTools.buildLayeredImage { + name = "gonzague/bundletool"; + tag = "latest"; + contents = with pkgs; [ wget bundletool aapt ]; +} \ No newline at end of file From c42f21fa0ab35adeee1a378d2cce15c0cf3c0f00 Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sun, 17 Dec 2023 18:34:38 +0800 Subject: [PATCH 2/5] set path to aapt2 in drone --- .drone.yml | 2 +- docker/bundletool.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index af3dde6e..50541f9b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -48,7 +48,7 @@ steps: - wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks - . /tmp/key.properties - cd build/app/outputs/bundle/release/ - - bundletool build-apks --bundle=app-release.aab --output=app-release.apks --ks-pass=pass:$${storePassword} --ks=/tmp/keystore.jks --ks-key-alias=upload --key-pass=pass:$${keyPassword} + - bundletool build-apks --bundle=app-release.aab --output=app-release.apks --ks-pass=pass:$${storePassword} --ks=/tmp/keystore.jks --ks-key-alias=upload --key-pass=pass:$${keyPassword} --aapt2=/bin/aapt2 # when: # event: tag - name: Publish diff --git a/docker/bundletool.nix b/docker/bundletool.nix index 30e15b34..7e9b4142 100644 --- a/docker/bundletool.nix +++ b/docker/bundletool.nix @@ -9,5 +9,5 @@ pkgs.dockerTools.buildLayeredImage { name = "gonzague/bundletool"; tag = "latest"; - contents = with pkgs; [ wget bundletool aapt ]; + contents = with pkgs; [ wget bundletool aapt bash which android-tools ]; } \ No newline at end of file From 200f78e2aed29b5761bc57cad48fbcb1157300cd Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sun, 17 Dec 2023 18:44:37 +0800 Subject: [PATCH 3/5] remove nix-env --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 50541f9b..74f1de66 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,7 +42,6 @@ steps: SERVER_URL: from_secret: server_url commands: - - nix-env -iA nixpkgs.wget nixpkgs.bundletool - wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json - wget http://$SERVER_URL/key.properties -O /tmp/key.properties - wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks From 623e9e588a08c1c0c8f90ca92e38d0ed0ae84d68 Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sun, 17 Dec 2023 18:59:22 +0800 Subject: [PATCH 4/5] add /tmp folder --- .drone.yml | 1 + docker/bundletool.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 74f1de66..94f68d72 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,6 +42,7 @@ steps: SERVER_URL: from_secret: server_url commands: + - mkdir /tmp - wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json - wget http://$SERVER_URL/key.properties -O /tmp/key.properties - wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks diff --git a/docker/bundletool.nix b/docker/bundletool.nix index 7e9b4142..d922393d 100644 --- a/docker/bundletool.nix +++ b/docker/bundletool.nix @@ -9,5 +9,5 @@ pkgs.dockerTools.buildLayeredImage { name = "gonzague/bundletool"; tag = "latest"; - contents = with pkgs; [ wget bundletool aapt bash which android-tools ]; + contents = with pkgs; [ toybox wget bundletool aapt bash android-tools ]; } \ No newline at end of file From b9d6c2646349a047bf6f846c8b4822b5c4e9f3f4 Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sun, 17 Dec 2023 19:10:44 +0800 Subject: [PATCH 5/5] make build when tags --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 94f68d72..c3afe3a5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,8 +33,8 @@ steps: - cp /tmp/build/build/app/outputs/bundle/release/* build/app/outputs/bundle/release/ - ls build/app/outputs/flutter-apk/ - ls build/app/outputs/bundle/release/ -# when: -# event: tag + when: + event: tag - name: Accrescent APKs image: gonzague/bundletool environment: @@ -49,8 +49,8 @@ steps: - . /tmp/key.properties - cd build/app/outputs/bundle/release/ - bundletool build-apks --bundle=app-release.aab --output=app-release.apks --ks-pass=pass:$${storePassword} --ks=/tmp/keystore.jks --ks-key-alias=upload --key-pass=pass:$${keyPassword} --aapt2=/bin/aapt2 -# when: -# event: tag + when: + event: tag - name: Publish image: plugins/github-release settings: