Skip to content

Commit f00a2dd

Browse files
committed
Expo CI
1 parent 2d3f7b6 commit f00a2dd

10 files changed

Lines changed: 250 additions & 13 deletions

File tree

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
**/target
22
**/node_modules
3-
**/dist
3+
apps/polycentric/dist
44
**/.git

.easignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# EAS-only ignore list. When this file exists, EAS uses it instead of
2+
# `.gitignore` files for the upload bundle. Mirrors the root
3+
# `.gitignore` minus the wildcard in
4+
# `packages/rs-core-wasm-browser/.gitignore` — those wasm artifacts
5+
# aren't committed, but EAS can't run wasm-pack, so it needs the
6+
# prebuilt output uploaded.
7+
8+
# Dependencies
9+
node_modules/
10+
.pnpm-store/
11+
.pnp
12+
.pnp.js
13+
14+
# Rust build output
15+
target/
16+
17+
# Note: workspace package `dist/` and `build/` directories are NOT
18+
# ignored — packages like `@polycentric/js-core` are consumed via their
19+
# built output (their `main` field points into `dist/`), so EAS needs
20+
# them uploaded. Native build dirs are excluded individually below.
21+
.expo/
22+
web-build/
23+
*.tsbuildinfo
24+
25+
# The app's own web export isn't part of the native build.
26+
apps/polycentric/dist/
27+
28+
# Test / CI artifacts
29+
coverage/
30+
__screenshots__/
31+
junit.xml
32+
junit-server.xml
33+
34+
# Env / local
35+
.env
36+
.env.local
37+
.env.*.local
38+
39+
# Editor / OS
40+
.DS_Store
41+
.vscode/
42+
.idea/
43+
*.swp
44+
*~
45+
46+
# Logs
47+
npm-debug.log*
48+
yarn-debug.log*
49+
yarn-error.log*
50+
51+
# Native build artifacts under the app. Patterns containing a `/`
52+
# match relative to this `.easignore`, so use the full project path.
53+
apps/polycentric/ios/Pods/
54+
apps/polycentric/ios/build/
55+
apps/polycentric/ios/DerivedData/
56+
apps/polycentric/android/.gradle/
57+
apps/polycentric/android/build/
58+
apps/polycentric/android/app/build/
59+
apps/polycentric/android/app/.cxx/
60+
*.xcuserstate
61+
*.iml
62+
63+
# Metro / Expo generated
64+
.metro-health-check*
65+
expo-env.d.ts
66+
67+
# Turborepo
68+
.turbo/
69+
70+
# Misc
71+
.claude/
72+
docker-compose.live*
73+
74+
# Backend / legacy aren't part of the mobile app upload
75+
services/
76+
legacy/
77+
78+
# Browser SDK demo (~150MB of node_modules + bundle, irrelevant to the native build)
79+
packages/js-browser/examples/

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include:
22
- local: '.gitlab/ci/build_rs_core.yml'
33
- local: '.gitlab/ci/build_js_sdks.yml'
4+
- local: '.gitlab/ci/build_rn_sdk.yml'
45
- local: '.gitlab/ci/build_server.yml'
56
- local: '.gitlab/ci/build_app.yml'
67
- local: '.gitlab/ci/deploy_pages.yml'

.gitlab/ci/build_app.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,21 @@
1414
- apps/**/*
1515
- .gitlab/ci/build_app.yml
1616

17-
app-web-image:
17+
.app-build-base:
1818
extends: .app-workflow
19-
image:
20-
name: moby/buildkit:rootless
21-
entrypoint: ['']
2219
needs:
20+
- job: rn-sdk-build
21+
artifacts: true
22+
- job: js-sdks-build
23+
artifacts: true
2324
- job: rs-sdk-build-wasm-browser
2425
artifacts: true
26+
27+
app-web-image:
28+
extends: .app-build-base
29+
image:
30+
name: moby/buildkit:rootless
31+
entrypoint: ['']
2532
before_script:
2633
- mkdir -p ~/.docker
2734
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json
@@ -33,4 +40,32 @@ app-web-image:
3340
--local context=. \
3441
--local dockerfile=./apps/polycentric \
3542
--opt build-arg:EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS=$EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS \
43+
--opt build-arg:SKIP_WORKSPACE_BUILD=1 \
3644
--output type=image,name=$CI_REGISTRY_IMAGE/app:$CI_COMMIT_SHA,push=true
45+
46+
.app-build-expo:
47+
extends: .app-build-base
48+
stage: build
49+
image: node:24-slim
50+
before_script:
51+
- npm install -g pnpm@9.5.0
52+
- pnpm config set @polycentric:registry https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
53+
- pnpm install
54+
- apt-get update && apt-get install -y --no-install-recommends git
55+
- cd ./apps/polycentric
56+
57+
app-android-apk:
58+
extends: .app-build-expo
59+
script:
60+
- npx eas-cli build --platform android --profile preview --non-interactive --no-wait
61+
62+
app-android-aab:
63+
extends: .app-build-expo
64+
script:
65+
- npx eas-cli build --platform android --non-interactive --no-wait
66+
when: manual
67+
68+
app-ios:
69+
extends: .app-build-expo
70+
script:
71+
- npx eas-cli build --platform ios --non-interactive --no-wait

.gitlab/ci/build_js_sdks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.js-sdk-workflow:
2-
image: node:24
2+
image: node:24-slim
33
rules:
44
- if: $CI_COMMIT_TAG =~ /^js-sdk-/
55
when: always
@@ -39,6 +39,10 @@ js-sdks-build:
3939
paths:
4040
- packages/js-*/dist
4141
expire_in: 1 week
42+
rules:
43+
- !reference [.js-sdk-workflow, rules]
44+
- !reference [.rn-sdk-workflow, rules]
45+
- !reference [.app-workflow, rules]
4246

4347
.js-sdks-publish-npm:
4448
rules:

.gitlab/ci/build_rn_sdk.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.rn-sdk-workflow:
2+
image: node:24-slim
3+
rules:
4+
- if: $CI_COMMIT_TAG =~ /^rn-sdk-/
5+
when: always
6+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
7+
changes:
8+
- packages/react-native/**/*
9+
- .gitlab/ci/build_rn_sdks.yml
10+
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
11+
when: never
12+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
13+
changes:
14+
- packages/react-native/**/*
15+
- .gitlab/ci/build_rn_sdks.yml
16+
17+
.rn-sdk-base:
18+
extends: .rn-sdk-workflow
19+
before_script:
20+
- npm install -g pnpm@9.5.0
21+
- pnpm config set @polycentric:registry https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
22+
- pnpm install
23+
needs:
24+
- job: js-sdks-build
25+
artifacts: true
26+
- job: rs-sdk-build-android-arm64
27+
artifacts: true
28+
- job: rs-sdk-build-android-armv7
29+
artifacts: true
30+
- job: rs-sdk-build-android-x86
31+
artifacts: true
32+
- job: rs-sdk-build-android-x86_64
33+
artifacts: true
34+
- job: rs-sdk-build-ios-device
35+
artifacts: true
36+
- job: rs-sdk-build-wasm-browser
37+
artifacts: true
38+
39+
rn-sdk-build:
40+
extends: .rn-sdk-base
41+
stage: build
42+
script:
43+
- mkdir -p packages/react-native/android/libs/arm64-v8a
44+
- cp target/aarch64-linux-android/release-rs-core/libpolycentric_core.a packages/react-native/android/libs/arm64-v8a/
45+
- mkdir -p packages/react-native/android/libs/armeabi-v7a
46+
- cp target/armv7-linux-androideabi/release-rs-core/libpolycentric_core.a packages/react-native/android/libs/armeabi-v7a/
47+
- mkdir -p packages/react-native/android/libs/x86
48+
- cp target/i686-linux-android/release-rs-core/libpolycentric_core.a packages/react-native/android/libs/x86/
49+
- mkdir -p packages/react-native/android/libs/x86_64
50+
- cp target/x86_64-linux-android/release-rs-core/libpolycentric_core.a packages/react-native/android/libs/x86_64/
51+
- mkdir -p packages/react-native/ios/libs/aarch64-apple-ios
52+
- cp buildRsCoreIOSDevice/binary/libpolycentric_core-ios-device.a packages/react-native/ios/libs/aarch64-apple-ios/libpolycentric_core.a
53+
- cd packages/react-native
54+
- pnpm build
55+
artifacts:
56+
paths:
57+
- packages/react-native/lib
58+
- packages/react-native/android/libs
59+
- packages/react-native/ios/libs
60+
expire_in: 1 week
61+
rules:
62+
- !reference [.rs-sdk-workflow, rules]
63+
- !reference [.app-workflow, rules]

.gitlab/ci/build_rs_core.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@
2222
WASM_IMAGE: '${CI_REGISTRY}/${CI_PROJECT_PATH}:wasm'
2323
ANDROID_IMAGE: '${CI_REGISTRY}/${CI_PROJECT_PATH}:android'
2424
RUST_CORE_PATH: packages/rs-core
25+
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
26+
cache:
27+
- key:
28+
files:
29+
- packages/rs-core/Cargo.lock
30+
prefix: rs-sdk-cargo-deps
31+
paths:
32+
- .cargo/registry/index
33+
- .cargo/registry/cache
34+
- .cargo/git/db
35+
- key:
36+
files:
37+
- packages/rs-core/Cargo.lock
38+
prefix: rs-sdk-target-${CI_JOB_NAME}
39+
paths:
40+
- target
2541
before_script:
2642
- cd packages/rs-core
2743

@@ -82,6 +98,9 @@ build-android-image:
8298
extends: .rs-sdk-workflow
8399
image: ${ANDROID_IMAGE}
84100
stage: build
101+
rules:
102+
- !reference [.rs-sdk-workflow, rules]
103+
- !reference [.app-workflow, rules]
85104

86105
rs-sdk-format-check:
87106
extends: .rust-check

apps/polycentric/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ WORKDIR /app
1313
ARG EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS
1414
ENV EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS=$EXPO_PUBLIC_POLYCENTRIC_SEED_SERVERS
1515

16+
# CI populates packages/js-*/dist, packages/react-native/lib, and
17+
# packages/rs-core-wasm-browser from upstream artifacts and sets this
18+
# to skip the redundant `pnpm run build`. Local builds leave it unset
19+
# and fall through to a full workspace build.
20+
ARG SKIP_WORKSPACE_BUILD=
21+
1622
COPY .npmrc turbo.jsonc pnpm-lock.yaml pnpm-workspace.yaml package.json ./
1723
COPY apps apps
1824
COPY packages packages
1925
COPY tools tools
2026
RUN pnpm install --frozen-lockfile
21-
# Build js-*
22-
RUN pnpm run build
23-
# Export Expo static app
27+
RUN if [ -z "$SKIP_WORKSPACE_BUILD" ]; then pnpm run build; fi
2428
RUN cd apps/polycentric && npx expo export --platform web
25-
# Self-contained prod bundle: real-file node_modules + package.json (no symlinks)
29+
# Non symlinked packages and node_modules
2630
RUN pnpm --filter polycentric-app --prod --legacy deploy /deploy
2731

2832
# Stage 3: Run

apps/polycentric/app.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@
1212
"userInterfaceStyle": "automatic",
1313
"ios": {
1414
"supportsTablet": true,
15-
"bundleIdentifier": "org.futo.polycentric"
15+
"bundleIdentifier": "org.futo.polycentric",
16+
"infoPlist": {
17+
"NSCameraUsageDescription": "$(PRODUCT_NAME) needs access to your Camera."
18+
}
1619
},
1720
"android": {
1821
"adaptiveIcon": {
1922
"foregroundImage": "./src/common/assets/images/AppIcon.png",
2023
"backgroundColor": "#ffffff"
2124
},
2225
"edgeToEdgeEnabled": true,
23-
"package": "org.futo.polycentric"
26+
"package": "org.futo.polycentric",
27+
"permissions": ["android.permission.CAMERA"]
2428
},
2529
"plugins": [
2630
"expo-router",
@@ -60,6 +64,13 @@
6064
],
6165
"experiments": {
6266
"typedRoutes": true
63-
}
67+
},
68+
"extra": {
69+
"router": {},
70+
"eas": {
71+
"projectId": "4db035ec-2de9-448a-a6cf-07347d6ae8b9"
72+
}
73+
},
74+
"owner": "futo-org"
6475
}
6576
}

apps/polycentric/eas.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"cli": {
3+
"version": ">= 18.8.1",
4+
"appVersionSource": "remote"
5+
},
6+
"build": {
7+
"development": {
8+
"developmentClient": true,
9+
"distribution": "internal"
10+
},
11+
"preview": {
12+
"distribution": "internal"
13+
},
14+
"production": {
15+
"autoIncrement": true
16+
}
17+
},
18+
"submit": {
19+
"production": {}
20+
}
21+
}

0 commit comments

Comments
 (0)