Skip to content

Commit d4c9996

Browse files
committed
init
0 parents  commit d4c9996

File tree

561 files changed

+78156
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

561 files changed

+78156
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Android E2E Tests
2+
3+
on:
4+
workflow_dispatch: # This allows manual triggering if needed
5+
release:
6+
types: [disabled_event_that_never_happens]
7+
8+
jobs:
9+
android-e2e-tests:
10+
runs-on: macos-latest # macOS runner typically has more space
11+
defaults:
12+
run:
13+
working-directory: ./mobile
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '18'
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v2
25+
with:
26+
version: 8
27+
28+
- name: Install dependencies
29+
run: pnpm install:all
30+
31+
- name: Set up JDK 17
32+
uses: actions/setup-java@v3
33+
with:
34+
java-version: '17'
35+
distribution: 'temurin'
36+
37+
- name: Setup Android SDK
38+
uses: android-actions/setup-android@v2
39+
40+
- name: Build Android app
41+
run: |
42+
pnpm exec expo prebuild --platform android --clean
43+
cd android
44+
./gradlew assembleDebug
45+
46+
- name: Create and start emulator
47+
run: |
48+
echo "no" | avdmanager --verbose create avd --force --name test --package "system-images;android-29;default;x86_64" --device "pixel" --sdcard 512M
49+
echo "hw.ramSize=2048" >> ~/.android/avd/test.avd/config.ini
50+
$ANDROID_HOME/emulator/emulator -avd test -no-audio -no-boot-anim -no-window -accel on &
51+
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
52+
53+
- name: Run Maestro test
54+
run: |
55+
adb install android/app/build/outputs/apk/debug/app-debug.apk
56+
pnpm e2e:android:test
57+
58+
- name: Upload test artifacts
59+
uses: actions/upload-artifact@v3
60+
if: always()
61+
with:
62+
name: maestro-test-results
63+
path: |
64+
~/.maestro/tests
65+
/tmp/maestro

.github/workflows/e2e-ios-test.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: iOS E2E Tests
2+
3+
on:
4+
workflow_dispatch: # This allows manual triggering if needed
5+
release:
6+
types: [disabled_event_that_never_happens]
7+
8+
jobs:
9+
ios-e2e-tests:
10+
runs-on: macos-latest
11+
defaults:
12+
run:
13+
working-directory: ./mobile
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18'
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: 8
26+
27+
- name: Install dependencies
28+
run: |
29+
pnpm install:all
30+
pnpm add -g expo-cli@latest eas-cli
31+
32+
- name: Check font installation
33+
run: |
34+
ls -R node_modules/@expo-google-fonts
35+
cat package.json
36+
echo "Font paths from app.json:"
37+
grep -A 4 '"fonts":' app.json
38+
39+
- name: Install Maestro
40+
run: |
41+
curl -Ls "https://get.maestro.mobile.dev" | bash
42+
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
43+
44+
- name: Setup iOS simulator
45+
run: |
46+
brew install watchman
47+
xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15
48+
49+
- name: Build iOS app
50+
env:
51+
EXPO_PUBLIC_ENVIRONMENT: production
52+
run: |
53+
pnpm ios
54+
55+
- name: Run Maestro tests
56+
env:
57+
EXPO_PUBLIC_ENVIRONMENT: production
58+
run: |
59+
pnpm e2e:ios:test
60+
61+
- name: Upload test artifacts
62+
uses: actions/upload-artifact@v3
63+
if: failure()
64+
with:
65+
name: maestro-test-results
66+
path: |
67+
~/.maestro/tests
68+
/tmp/maestro

.github/workflows/release.yml

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
name: Expo Build and Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'App version'
10+
required: true
11+
default: '1.0.0'
12+
13+
jobs:
14+
build-and-release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: 19.x #v20 might have issues for some reason according to Web
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 6.32.9
28+
29+
- name: Benchmark
30+
id: benchmark
31+
working-directory: ./backend
32+
run: |
33+
pnpm benchmark
34+
# Archive benchmark result files
35+
if [ -d "benchmarks" ]; then
36+
tar -czf benchmarks.tar.gz -C benchmarks .
37+
else
38+
echo "No benchmarks directory found."
39+
fi
40+
41+
# Setup Google Cloud Authentication
42+
- name: Google Auth
43+
id: auth
44+
uses: google-github-actions/auth@v2
45+
with:
46+
credentials_json: ${{ secrets.GCP_SA_KEY }}
47+
token_format: 'access_token'
48+
49+
# Configure Docker for GCP Artifact Registry
50+
- name: Set up Cloud SDK
51+
uses: google-github-actions/setup-gcloud@v2
52+
53+
- name: Configure Docker for Artifact Registry
54+
run: |
55+
gcloud auth configure-docker europe-west6-docker.pkg.dev
56+
57+
# Get the version for Docker tag
58+
- name: Get version
59+
id: get_version
60+
run: |
61+
if [ "${{ github.event_name }}" = "release" ]; then
62+
# Extract version from tag, removing both 'refs/tags/' and 'v' prefix if present
63+
VERSION=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')
64+
else
65+
VERSION=${{ github.event.inputs.version }}
66+
fi
67+
echo "VERSION=$VERSION" >> $GITHUB_ENV
68+
69+
# Build and push Docker image
70+
- name: Build and push Docker image
71+
working-directory: ./backend
72+
run: |
73+
docker build -t europe-west6-docker.pkg.dev/offlinery-439317/offlinery-backend/nestjs:${{ env.VERSION }} .
74+
docker push europe-west6-docker.pkg.dev/offlinery-439317/offlinery-backend/nestjs:${{ env.VERSION }}
75+
76+
- name: Install dependencies
77+
working-directory: ./mobile
78+
run: |
79+
pnpm install:all
80+
81+
- name: Setup Sentry CLI
82+
run: |
83+
curl -sL https://sentry.io/get-cli/ | bash
84+
sentry-cli --version
85+
86+
- name: Create Sentry Release
87+
working-directory: ./mobile
88+
env:
89+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
90+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
91+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
92+
run: |
93+
sentry-cli releases new ${{ env.VERSION }}
94+
sentry-cli releases set-commits ${{ env.VERSION }} --auto
95+
96+
- name: Setup Expo and EAS
97+
uses: expo/expo-github-action@v8
98+
with:
99+
eas-version: latest
100+
token: ${{ secrets.EXPO_TOKEN }}
101+
102+
- name: Build on EAS
103+
working-directory: ./mobile
104+
run: |
105+
BUILD_URL=$(eas build --platform all --non-interactive --json | jq -r '.buildUrl')
106+
echo "BUILD_URL=$BUILD_URL" >> $GITHUB_ENV
107+
108+
# Create archives for source maps
109+
- name: Archive Source Maps
110+
working-directory: ./mobile
111+
run: |
112+
# Archive Android source maps
113+
if [ -d "android/app/build/generated/sourcemaps" ]; then
114+
tar -czf android-sourcemaps.tar.gz -C android/app/build/generated/sourcemaps .
115+
fi
116+
117+
# Archive iOS source maps
118+
if [ -d "ios/build/generated/sourcemaps" ]; then
119+
tar -czf ios-sourcemaps.tar.gz -C ios/build/generated/sourcemaps .
120+
fi
121+
122+
# Upload source maps to Sentry after the build
123+
- name: Upload Source Maps to Sentry
124+
working-directory: ./mobile
125+
env:
126+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
127+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
128+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
129+
run: |
130+
# Upload source maps for Android
131+
sentry-cli react-native sourcemaps upload \
132+
--release ${{ env.VERSION }} \
133+
--dist android \
134+
--platform android \
135+
android/app/build/generated/sourcemaps
136+
137+
# Upload source maps for iOS
138+
sentry-cli react-native sourcemaps upload \
139+
--release ${{ env.VERSION }} \
140+
--dist ios \
141+
--platform ios \
142+
ios/build/generated/sourcemaps
143+
144+
# Upload Proguard mappings for Android
145+
if [ -f "android/app/build/outputs/mapping/release/mapping.txt" ]; then
146+
sentry-cli upload-proguard \
147+
--android-manifest android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml \
148+
--project ${{ secrets.SENTRY_PROJECT }} \
149+
--org ${{ secrets.SENTRY_ORG }} \
150+
android/app/build/outputs/mapping/release/mapping.txt
151+
fi
152+
153+
- name: Finalize Sentry Release
154+
working-directory: ./mobile
155+
env:
156+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
157+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
158+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
159+
run: |
160+
sentry-cli releases finalize ${{ env.VERSION }}
161+
162+
- name: Update GitHub Release
163+
uses: softprops/action-gh-release@v1
164+
if: startsWith(github.ref, 'refs/tags/')
165+
with:
166+
body: |
167+
Expo Build URL: ${{ env.BUILD_URL }}
168+
Backend Docker Image: europe-west6-docker.pkg.dev/offlinery-439317/offlinery-backend/nestjs:${{ env.VERSION }}
169+
files: |
170+
mobile/android-sourcemaps.tar.gz
171+
mobile/ios-sourcemaps.tar.gz
172+
mobile/android/app/build/outputs/mapping/release/mapping.txt
173+
env:
174+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
176+
# Submit to app stores
177+
- name: Submit to App Store Connect (TestFlight)
178+
working-directory: ./mobile
179+
if: env.IOS_BUILD_ID != ''
180+
env:
181+
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
182+
run: |
183+
eas submit --platform ios --id ${{ env.IOS_BUILD_ID }} --non-interactive
184+
185+
- name: Submit to Google Play Console (Internal Testing)
186+
working-directory: ./mobile
187+
if: env.ANDROID_BUILD_ID != ''
188+
env:
189+
EXPO_GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.EXPO_GOOGLE_SERVICE_ACCOUNT_JSON }}
190+
run: |
191+
eas submit --platform android --id ${{ env.ANDROID_BUILD_ID }} --track internal --non-interactive

0 commit comments

Comments
 (0)