From dfd1f202ad3ea585ccb7f6f7a106f9fd4b968fd9 Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Sat, 2 Nov 2024 18:35:19 -0400 Subject: [PATCH] GitHub Workflows: Build Android: run on pushes to master and show hashes --- .github/workflows/build-android.yml | 9 +++++++-- build.sh | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index cdcdbe2eb..95e628e7d 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -8,13 +8,18 @@ on: permissions: users: - kaloudis + push: + branches: + - "master" + pull_request: + branches: + - "*" jobs: build-android: runs-on: ubuntu-latest - container: reactnativecommunity/react-native-android@sha256:6607421944d844b82e4d05df50c11dc9fa455108222d63475cd3a0f62465fbda steps: - uses: actions/checkout@v4 - name: Envinfo run: npx envinfo - name: Build application - run: yarn install && cd android && chmod +x gradlew && ./gradlew app:assembleRelease \ No newline at end of file + run: chmod +x build.sh && bash ./build.sh --no-tty \ No newline at end of file diff --git a/build.sh b/build.sh index 0c38b466b..4c489e4a6 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,20 @@ BUILDER_IMAGE="reactnativecommunity/react-native-android@sha256:6607421944d844b8 CONTAINER_NAME="zeus_builder_container" ZEUS_PATH=/olympus/zeus -docker run --rm -it --name $CONTAINER_NAME -v `pwd`:$ZEUS_PATH $BUILDER_IMAGE bash -c \ +# Default options for the Docker command +TTY_FLAG="-it" + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --no-tty) TTY_FLAG="" ;; # Remove -it if --no-tty is provided + *) echo "Unknown parameter: $1" && exit 1 ;; + esac + shift +done + +# Run the Docker command +docker run --rm $TTY_FLAG --name $CONTAINER_NAME -v "$(pwd):$ZEUS_PATH" $BUILDER_IMAGE bash -c \ 'echo -e "\n\n********************************\n*** Building ZEUS...\n********************************\n" && \ cd /olympus/zeus ; yarn install --frozen-lockfile && \ cd /olympus/zeus/android ; ./gradlew app:assembleRelease && \ @@ -18,4 +31,3 @@ docker run --rm -it --name $CONTAINER_NAME -v `pwd`:$ZEUS_PATH $BUILDER_IMAGE ba sha256sum $RENAMED_FILENAME done && \ echo -e "\n" '; -