Skip to content

Commit 27ec7a9

Browse files
Merge pull request #4 from codebuilderinc/merge-nightly-workflow-and-global-error-and-new-login-screen
Merge nightly workflow and global error and new login screen
2 parents c8bda77 + 8a3ed92 commit 27ec7a9

24 files changed

Lines changed: 1639 additions & 916 deletions

.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copy this file to `.env` and fill in your values
2+
# These are consumed by app.config.js via dotenv at build time
3+
4+
# Firebase config (also present in google-services.json / GoogleService-Info.plist for native)
5+
FIREBASE_API_KEY=
6+
FIREBASE_AUTH_DOMAIN=
7+
FIREBASE_PROJECT_ID=
8+
FIREBASE_STORAGE_BUCKET=
9+
FIREBASE_MESSAGING_SENDER_ID=
10+
FIREBASE_APP_ID=
11+
12+
# Google Sign-In: REQUIRED for offline access and proper sign-in on native
13+
# Provide the OAuth 2.0 Client ID of type "Web application" from Google Cloud console (same project as your iOS/Android clients)
14+
GOOGLE_WEB_CLIENT_ID=
15+
16+
# Optional: Maps (Android)
17+
GOOGLE_MAPS_API_KEY=
18+
19+
# Build metadata
20+
BUILD_DATE=

.github/workflows/eas-android-build.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ permissions:
44

55
on:
66
push:
7-
branches: [main]
7+
branches: ["**"] # Run on all branches
88
workflow_dispatch:
99

1010
env:
@@ -21,6 +21,7 @@ jobs:
2121
build_number: ${{ steps.version-control.outputs.build_number }}
2222
build_date: ${{ steps.version-control.outputs.build_date }}
2323
is_production: ${{ steps.version-control.outputs.is_production }}
24+
branch_name: ${{ steps.extract-branch.outputs.branch_name }}
2425
steps:
2526
# ========================
2627
# 🛠️ Repository Setup
@@ -30,6 +31,14 @@ jobs:
3031
with:
3132
fetch-depth: 0
3233

34+
- name: "🔍 Extract branch name"
35+
id: extract-branch
36+
shell: bash
37+
run: |
38+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
39+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
40+
echo "Branch: $BRANCH_NAME"
41+
3342
# ========================
3443
# ⚙️ Environment Configuration
3544
# ========================
@@ -73,7 +82,12 @@ jobs:
7382
APP_VERSION=$(jq -r '.version' version.json)
7483
IS_PRODUCTION="true"
7584
else
76-
APP_VERSION="1.0.0-prerelease.${{ github.run_number }}"
85+
# For non-main branches, create a prerelease version with branch name
86+
BRANCH_NAME=${{ steps.extract-branch.outputs.branch_name }}
87+
SANITIZED_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9]/-/g')
88+
# Get base version from version.json
89+
BASE_VERSION=$(jq -r '.version' version.json)
90+
APP_VERSION="${BASE_VERSION}-pre.${SANITIZED_BRANCH}.${{ github.run_number }}"
7791
IS_PRODUCTION="false"
7892
fi
7993
@@ -109,7 +123,17 @@ jobs:
109123
run: |
110124
echo "🔄 Initializing build process..."
111125
sudo apt-get install -y jq
112-
BUILD_JSON=$(npx eas build -p android --profile production --non-interactive --json)
126+
127+
# Choose profile based on branch
128+
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
129+
BUILD_PROFILE="production"
130+
else
131+
BUILD_PROFILE="preview" # Use a different profile for pre-releases if needed
132+
fi
133+
134+
echo "Using build profile: $BUILD_PROFILE"
135+
136+
BUILD_JSON=$(npx eas build -p android --profile $BUILD_PROFILE --non-interactive --json)
113137
echo "Raw build output: $BUILD_JSON"
114138
BUILD_ID=$(echo "$BUILD_JSON" | jq -r '.[0].id')
115139
if [[ -z "$BUILD_ID" || "$BUILD_ID" == "null" ]]; then
@@ -274,7 +298,6 @@ jobs:
274298
CHANGELOG=$(git log --pretty=format:"- %s (%h) by %an" -n 15)
275299
echo "$CHANGELOG" > changelog.txt
276300
277-
# FIXED OUTPUT HANDLING (ONLY CHANGE)
278301
delimiter=$(openssl rand -hex 6)
279302
echo "CHANGELOG<<${delimiter}" >> $GITHUB_OUTPUT
280303
cat changelog.txt >> $GITHUB_OUTPUT
@@ -316,11 +339,14 @@ jobs:
316339
RELEASE_TAG="v${{ needs.build-android.outputs.app_version }}"
317340
RELEASE_TITLE="Production Release v${{ needs.build-android.outputs.app_version }}"
318341
else
319-
echo "🟡 Nightly build detected"
320-
RELEASE_TAG="nightly-${{ needs.build-android.outputs.build_date }}"
321-
RELEASE_TITLE="Nightly Build (${{ needs.build-android.outputs.build_date }})"
342+
echo "🟡 Pre-release build detected"
343+
BRANCH_NAME="${{ needs.build-android.outputs.branch_name }}"
344+
RELEASE_TAG="prerelease-${BRANCH_NAME}-${{ needs.build-android.outputs.build_date }}"
345+
RELEASE_TITLE="Pre-release (${BRANCH_NAME}) v${{ needs.build-android.outputs.app_version }}"
322346
fi
323347
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_OUTPUT
348+
echo "RELEASE_TITLE=${RELEASE_TITLE}" >> $GITHUB_OUTPUT
349+
324350
- name: "🎉 Publish GitHub Release"
325351
uses: softprops/action-gh-release@v2
326352
with:

GoogleService-Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<true></true>
2525
<key>IS_SIGNIN_ENABLED</key>
2626
<true></true>
27+
<key>CLIENT_ID</key>
28+
<string>906784991953-aoq1tgiac6ge9aqv4kguai26265393h9.apps.googleusercontent.com</string>
29+
<key>REVERSED_CLIENT_ID</key>
30+
<string>com.googleusercontent.apps.906784991953-aoq1tgiac6ge9aqv4kguai26265393h9</string>
2731
<key>GOOGLE_APP_ID</key>
2832
<string>1:982053776531:ios:eec4ee1692d95d2ce3b166</string>
2933
</dict>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ CodeBuilder Admin is a mobile application built with React Native and Expo. This
4040

4141
```env
4242
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
43+
GOOGLE_WEB_CLIENT_ID=your_google_web_client_id
4344
FIREBASE_API_KEY=your_firebase_api_key
4445
FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
4546
FIREBASE_PROJECT_ID=your_firebase_project_id

0 commit comments

Comments
 (0)