diff --git a/.github/workflows/build-suite-native-preview.yml b/.github/workflows/build-suite-native-preview.yml new file mode 100644 index 000000000000..a9b93b3b54f7 --- /dev/null +++ b/.github/workflows/build-suite-native-preview.yml @@ -0,0 +1,60 @@ +name: "[Build] suite-native preview" + +on: + push: + # push develop(default) branch is necessary for this action to update its fingerprint database + branches: [develop] + pull_request: + paths: + - "suite-native/**" + - "packages/react-native-usb/**" + - "packages/transport-native/**" + - "yarn.lock" + # list of paths is not complete, but it's always possible to dispatch manually + workflow_dispatch: + +jobs: + update: + if: github.repository == 'trezor/trezor-suite' || github.repository == 'trezor/trezor-suite-private' + name: EAS Update + runs-on: ubuntu-latest + concurrency: fingerprint-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + EXPO_PUBLIC_ENVIRONMENT: preview + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + NODE_ENV: preview + permissions: + contents: read + pull-requests: write + actions: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: yarn + - name: Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN_DEVELOP }} + - name: Install libs + run: yarn workspaces focus @suite-native/app + + - name: Create preview builds if fingerprint changed + uses: expo/expo-github-action/preview-build@main + with: + command: eas build --profile preview --platform all + working-directory: suite-native/app + + - name: Install deps and build libs + run: | + yarn install --immutable + yarn message-system-sign-config + + - name: Create preview update + uses: expo/expo-github-action/preview@v8 + with: + command: eas update --auto --branch ${{ env.BRANCH_NAME }} + working-directory: suite-native/app diff --git a/suite-native/app/.env.preview b/suite-native/app/.env.preview index 605b5f252dde..d2479a3b6ff1 100644 --- a/suite-native/app/.env.preview +++ b/suite-native/app/.env.preview @@ -1,3 +1,2 @@ EXPO_PUBLIC_ENVIRONMENT=preview EXPO_PUBLIC_CODESIGN_BUILD=false -EXPO_PUBLIC_BLUETOOTH_ENABLED=true diff --git a/suite-native/app/.fingerprintignore b/suite-native/app/.fingerprintignore new file mode 100644 index 000000000000..ed463428a533 --- /dev/null +++ b/suite-native/app/.fingerprintignore @@ -0,0 +1,3 @@ +ios/**/* + +!ios/Podfile.lock diff --git a/suite-native/app/README.md b/suite-native/app/README.md index 6832b48a5a55..0507d0e4a39a 100644 --- a/suite-native/app/README.md +++ b/suite-native/app/README.md @@ -69,6 +69,10 @@ You can override ENV variables locally using `.env.development.local` (or `.env. > You can use `EXPO_PUBLIC_IS_ANALYTICS_LOGGER_ENABLED=true` in `.env.development.local` to debug analytics locally. +## Native changes - bumping runtimeVersion + +Whenever you do a change in a native code (updating native dependency and so on), you have to bump `runtimeVersion` in `app.config.ts` file manually so EAS knows that it has to prepare new development build. See [Runtime Versions Expo Docs](https://docs.expo.dev/distribution/runtime-versions/). Hopefully it's just a temporary situation until [fingerprint policy](https://docs.expo.dev/eas-update/runtime-versions/#fingerprint-runtime-version-policy) is finalized. Fingerprint policy is not working well with development builds yet, waiting for SDK 52. + ## Troubleshooting 1. For any issues with the build, try to clean the project and rebuild it: diff --git a/suite-native/app/app.config.ts b/suite-native/app/app.config.ts index 44bca2709500..0627abd40d88 100644 --- a/suite-native/app/app.config.ts +++ b/suite-native/app/app.config.ts @@ -169,16 +169,17 @@ export default ({ config }: ConfigContext): ExpoConfig => { slug: appSlugs[buildType], owner: appOwners[buildType], version: suiteNativeVersion, - runtimeVersion: { - policy: 'fingerprint', - }, - ...(buildType === 'develop' - ? { + runtimeVersion: '8', + ...(buildType === 'production' + ? {} + : { updates: { url: `https://u.expo.dev/${projectId}`, + requestHeaders: { + 'expo-channel-name': buildType, + }, }, - } - : {}), + }), orientation: 'portrait', splash: { image: './assets/splash_icon.png', diff --git a/suite-native/app/eas.json b/suite-native/app/eas.json index c45dd6ed68be..382d85961a6c 100644 --- a/suite-native/app/eas.json +++ b/suite-native/app/eas.json @@ -25,20 +25,16 @@ "EXPO_PUBLIC_ENVIRONMENT": "preview", "EXPO_PUBLIC_CODESIGN_BUILD": "false" }, + "channel": "preview", "autoIncrement": true, "developmentClient": true, "credentialsSource": "remote", "distribution": "internal" }, "adhoc": { - "env": { - "EXPO_PUBLIC_ENVIRONMENT": "preview", - "EXPO_PUBLIC_BLUETOOTH_ENABLED": "true", - "EXPO_PUBLIC_CODESIGN_BUILD": "false" - }, - "autoIncrement": true, - "credentialsSource": "remote", - "distribution": "internal" + "extends": "preview", + "developmentClient": false, + "channel": "adhoc" }, "production": { "env": {