Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo app bundles locally on any push request to test all modules compile #317

Closed
1 task
theblockstalk opened this issue Dec 21, 2022 · 4 comments
Closed
1 task
Assignees

Comments

@theblockstalk
Copy link
Contributor

theblockstalk commented Dec 21, 2022

Definition of done

  • On any pull request, a local expo Android .apk file bundle is created (eas service is not used)

Maximum spend of 6 hours on this.

Follow up: iOS

@theblockstalk
Copy link
Contributor Author

# https://docs.expo.dev/build-reference/local-builds/

FROM node:16.4.1

# inspired by https://github.com/Tonomy-Foundation/Tonomy-ID-Integration/pull/17/files#diff-e7b1ad59619c7785127c51bb5ae3edb0f1a8cb2c794b75a071b234b04abf581c

RUN apt-get update
RUN apt-get install -y \
    curl \
    git \
    zip \
    apt-utils \
    cmake

RUN apt install openjdk-11-jdk -y

RUN apt-get install wget unzip -y

ENV ANDROID_SDK_ROOT=/usr/lib/android-sdk
RUN mkdir -p $ANDROID_SDK_ROOT
WORKDIR $ANDROID_SDK_ROOT
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
RUN unzip commandlinetools-linux-9123335_latest.zip
RUN PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/bin
WORKDIR $ANDROID_SDK_ROOT/cmdline-tools/bin
RUN yes | ./sdkmanager --licenses --sdk_root=$ANDROID_SDK_ROOT/cmdline-tools
RUN ./sdkmanager --install "platform-tools" "platforms;android-31"  --sdk_root=$ANDROID_SDK_ROOT/cmdline-tools
# which version: https://docs.expo.dev/versions/latest/#support-for-android-and-ios-versions

RUN curl https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
RUN unzip android-ndk-r25b-linux.zip -d /opt/android-ndk

COPY . /app
WORKDIR /app
RUN ls

ENV EXPO_TOKEN=0Mq3p6JGTV0OkTWj9-mRCSx6iDIdv8yQdUOHvpHf
ENV NODE_ENV=development

RUN npm run build:prepare

RUN npx eas build --clear-cache --profile "${NODE_ENV}" --platform android --local

RUN ls

@theblockstalk
Copy link
Contributor Author

FROM cimg/android:2022.12.1-ndk
# See Android SDK and NDK version here https://circleci.com/developer/images/image/cimg/android

# TODO lock to v16.4.1
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
RUN sudo apt-get install -y nodejs

RUN node -v

COPY . /app
WORKDIR /app
RUN ls

ENV EXPO_TOKEN=0Mq3p6JGTV0OkTWj9-mRCSx6iDIdv8yQdUOHvpHf
ENV NODE_ENV=development

RUN npm run build:prepare

RUN npx eas build --clear-cache --profile "${NODE_ENV}" --platform android --local

RUN ls

@theblockstalk
Copy link
Contributor Author

Made two attempts in Dockerfiles to get this working and failed with both. Closing

@theblockstalk
Copy link
Contributor Author

changed a few things and now working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant