diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index cdcdbe2eb..18c08b240 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -8,13 +8,15 @@ on: permissions: users: - kaloudis + push: + branches: + - "master" 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" '; -