Update README.md #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- master | |
- dev | |
push: | |
branches: | |
- master | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🏗 Setup repo | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
submodules: "recursive" | |
- name: Set outputs | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: get build tools version | |
id: build_tools_version | |
run: | | |
echo "version=$(ls /usr/local/lib/android/sdk/build-tools/ | head -1)" >> $GITHUB_OUTPUT | |
ls /usr/local/lib/android/sdk/build-tools/ | head -1 | |
- name: 🏗 Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: yarn | |
- name: 🏗 Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: 📦 Install dependencies | |
run: yarn install | |
- name: create build directory | |
run: mkdir build | |
- name: 🚀 Build aab | |
run: NODE_OPTIONS=--max_old_space_size=4096 eas build --local --non-interactive --platform android --profile aab --output build/${{ steps.vars.outputs.sha_short }}.aab | |
- name: 🚀 Build app (android production) | |
run: eas build --local --non-interactive --platform android --profile production --output build/${{ steps.vars.outputs.sha_short }}.production.apk | |
- name: change app id (dev) | |
run: find ./ -path ./.git -prune -o -path ./node_modules -prune -o -path ./assets -prune -o -path ./.github -prune -o -type f -exec sed -i 's/me.wcyat.safecantoneseai/me.wcyat.safecantoneseaidev/g' {} \; | |
- name: allow internet (dev) | |
run: sed -i '/<uses-permission android:name="android.permission.INTERNET" tools:node="remove"\/>/d' android/app/src/main/AndroidManifest.xml | |
- name: 🚀 Build app (android development) | |
run: eas build --local --non-interactive --platform android --profile development --output build/${{ steps.vars.outputs.sha_short }}.development.apk | |
- name: add models to apks | |
run: | | |
zip -ur build/${{ steps.vars.outputs.sha_short }}.production.apk assets/models/*.bin | |
zip -ur build/${{ steps.vars.outputs.sha_short }}.development.apk assets/models/*.bin | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app APK | |
# ID used to access action output | |
id: sign_app | |
with: | |
releaseDirectory: build/ | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
# override default build-tools version (29.0.3) -- optional | |
BUILD_TOOLS_VERSION: ${{ steps.build_tools_version.outputs.version }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: android production apk | |
path: build/${{ steps.vars.outputs.sha_short }}.production-signed.apk # or path/to/artifact | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: android development apk | |
path: build/${{ steps.vars.outputs.sha_short }}.development-signed.apk # or path/to/artifact | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: android app bundle | |
path: build/${{ steps.vars.outputs.sha_short }}.aab # or path/to/artifact |