Skip to content

Merge branch 'master' into feature/trainsic-ui #2250

Merge branch 'master' into feature/trainsic-ui

Merge branch 'master' into feature/trainsic-ui #2250

Workflow file for this run

name: Build Android APK
# Use https://github.com/nektos/act to run this locally
# INSTALL:
# curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
# PREPARE: you need to have a `testnet` project in EAS:
# export EXPO_NODE_ENV=testnet
# export EXPO_FIRST_TIME=true
# yarn run build:android
# echo "Set the value of `expoProjectId` in src/config/config.testnet.json"
# echo "Get an access token from https://expo.dev/accounts/[account]/settings/access-tokens"
# export EXPO_TOKEN=rtsB...
# RUN:
# act -j build-android -s EXPO_TOKEN="${EXPO_TOKEN}" SENTRY_AUTH_TOKEN="${SENTRY_AUTH_TOKEN}" SENTRY_SECRET_KEY="${SENTRY_SECRET_KEY}" SENTRY_PROJECT_ID="${SENTRY_PROJECT_ID}" SENTRY_PUBLIC_KEY="${SENTRY_PUBLIC_KEY}" INFURA_KEY="${INFURA_KEY}" WALLETCONNECT_PROJECT_ID="${WALLETCONNECT_PROJECT_ID}" VERIFF_API_KEY="${VERIFF_API_KEY}" HCAPTCHA_SITE_KEY="${HCAPTCHA_SITE_KEY}""
on:
push
jobs:
build-android:
runs-on: ubuntu-latest
env:
EXPO_NODE_ENV: testnet
EXPO_PLATFORM: android
NODE_VERSION: 22.3.0
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
# https://expo.dev/accounts/[account]/settings/access-tokens
SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
# https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/
SENTRY_SECRET_KEY : ${{ secrets.SENTRY_SECRET_KEY }}
# https://sentry.io/orgredirect/organizations/:orgslug/projects/:projectslug/settings/keys/
SENTRY_PROJECT_ID : ${{ secrets.SENTRY_PROJECT_ID }}
SENTRY_PUBLIC_KEY : ${{ secrets.SENTRY_PUBLIC_KEY }}
# https://docs.sentry.io/api/projects/create-a-new-client-key/
INFURA_KEY: ${{ secrets.INFURA_KEY }}
# https://medium.com/jelly-market/how-to-get-infura-api-key-e7d552dd396f
WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID }}
# https://docs.blockscout.com/setup/configuration-options/walletconnect-project-id-for-contract-read-write
VERIFF_API_KEY: ${{ secrets.VERIFF_API_KEY }}
# https://devdocs.veriff.com/apidocs/veriff-public-api-guides
HCAPTCHA_SITE_KEY: ${{ secrets.HCAPTCHA_SITE_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
# ⚡ Free up disk space early
- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker system prune -af || true
echo "After cleanup:"
df -h
- name: Install nodejs
run: |
wget "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz"
sudo tar -C /usr/local --strip-components 1 -xzf "node-v${NODE_VERSION}-linux-x64.tar.gz"
sudo corepack enable
node -v && npm -v && yarn -v
rm "node-v${NODE_VERSION}-linux-x64.tar.gz"
- name: Install dependencies
run: yarn --immutable
- name: Install EAS
run: sudo npm install -g eas-cli@16.3.3
- name: 🚀 Build Android .apk app
run: |
yarn run build:prepare
npx eas build --clear-cache --profile "${{env.EXPO_NODE_ENV}}-internal" --platform "${EXPO_PLATFORM}" --local
- name: Find APK file and rename it so it can be added as an artifact
run: find . -name "*.apk" -exec mv {} "Tonomy-ID-${{env.EXPO_NODE_ENV}}.apk" \;
- name: Archive Android APK as artifact
# Do not run this step if the action is being run locally (using nektos/act)
if: ${{ github.actor != 'nektos/act' }}
uses: actions/upload-artifact@v4
with:
name: "TonomyID-Android-${{env.EXPO_NODE_ENV}}"
path: "./Tonomy-ID-${{env.EXPO_NODE_ENV}}.apk"