diff --git a/Dockerfile b/Dockerfile index c8dc5d9..4187699 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,9 @@ RUN yes | sdkmanager --licenses --sdk_root=$ANDROID_HOME && \ # Install rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_VERSION" +# Install git +RUN apt-get install -y git + # Cleanup RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ apt-get autoremove -y && \ diff --git a/scripts/build-podman-exec.sh b/scripts/build-podman-exec.sh index 7bc2885..3b7bed2 100755 --- a/scripts/build-podman-exec.sh +++ b/scripts/build-podman-exec.sh @@ -7,21 +7,27 @@ ALIGNED="/tmp/app-aligned.apk" source ~/.cargo/env +echo "Cloning repo" +git clone "https://github.com/LeanderBB/you-have-mail.git" /opt/project + cd /opt/project/you-have-mail-android # Build Project ./gradlew --no-daemon assembleRelease # Align zip +echo "Aligning apk" $ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION/zipalign -v 4 \ app/build/outputs/apk/release/app-release-unsigned.apk $ALIGNED # Sign apk +echo "Signing apk" echo $KEY_STORE_PWD | $ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION/apksigner sign \ --ks /opt/keystore \ --in $ALIGNED \ --out $OUTPUT # Verify +echo "Verifying apk" $ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION/apksigner verify $OUTPUT diff --git a/scripts/build-podman.sh b/scripts/build-podman.sh index 268db12..cc3ce42 100755 --- a/scripts/build-podman.sh +++ b/scripts/build-podman.sh @@ -4,9 +4,5 @@ set -eou pipefail mkdir -p artifacts -podman run --rm --volume $PWD:/opt/project:Z \ - --volume $PWD/artifacts:/opt/artifacts:rw \ - --secret android_keystore,type=mount,target=/opt/keystore \ - --secret android_key_pwd,type=env,target=KEY_STORE_PWD \ - -i -t yhm "/opt/project/scripts/build-podman-exec.sh" +scripts/podman-do.sh "/opt/scripts/build-podman-exec.sh"