Skip to content

Commit

Permalink
GitHub Workflows: Build Android: run on pushes to master and show hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Nov 2, 2024
1 parent 3b35eed commit dfd1f20
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: chmod +x build.sh && bash ./build.sh --no-tty
16 changes: 14 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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" ';

0 comments on commit dfd1f20

Please sign in to comment.