chore: add ci
This commit is contained in:
@@ -0,0 +1,122 @@
|
|||||||
|
name: Omnex Plateform App - EAS Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "omnex-plateform-app/**"
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "omnex-plateform-app/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: omnex-plateform-app/package-lock.json
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
|
||||||
|
- name: Install EAS CLI & tooling
|
||||||
|
run: |
|
||||||
|
npm install -g eas-cli
|
||||||
|
pip install -r scripts/requirements.txt awscli --quiet
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
run: npx tsc --noEmit
|
||||||
|
|
||||||
|
- name: Determine config
|
||||||
|
id: config
|
||||||
|
run: |
|
||||||
|
echo "profile=production" >> $GITHUB_OUTPUT
|
||||||
|
echo "channel=production-omnex-admin" >> $GITHUB_OUTPUT
|
||||||
|
echo "apk_name=omnex-plateform-app-production-$(date +%Y%m%d-%H%M).apk" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Inject EAS project ID
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
run: |
|
||||||
|
jq '.expo.extra.eas.projectId = "${{ secrets.EXPO_PROJECT_ID }}"' app.json > app.tmp.json
|
||||||
|
mv app.tmp.json app.json
|
||||||
|
|
||||||
|
- name: Restore Gradle cache (RustFS)
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
S3_ENDPOINT: https://rustfs.uber-stup.club
|
||||||
|
S3_BUCKET: apk-builds
|
||||||
|
run: python scripts/eas_cache.py restore --app omnex-plateform-app
|
||||||
|
|
||||||
|
- name: Build APK (local)
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
env:
|
||||||
|
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
EXPO_PUBLIC_UPDATE_URL: ${{ secrets.XAVIA_API_URL }}/api/manifest
|
||||||
|
EAS_BUILD_NO_EXPO_GO_WARNING: true
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=2048"
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
|
||||||
|
JAVA_TOOL_OPTIONS: "-Xmx3g"
|
||||||
|
run: eas build --platform android --profile ${{ steps.config.outputs.profile }} --local --non-interactive
|
||||||
|
|
||||||
|
- name: Save Gradle cache (RustFS)
|
||||||
|
if: success() || failure()
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
S3_ENDPOINT: https://rustfs.uber-stup.club
|
||||||
|
S3_BUCKET: apk-builds
|
||||||
|
run: python scripts/eas_cache.py save --app omnex-plateform-app
|
||||||
|
|
||||||
|
- name: Rename & upload APK to RustFS
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: us-east-1
|
||||||
|
run: |
|
||||||
|
mv *.apk ${{ steps.config.outputs.apk_name }}
|
||||||
|
aws s3 cp ${{ steps.config.outputs.apk_name }} \
|
||||||
|
s3://apk-builds/${{ steps.config.outputs.profile }}/${{ steps.config.outputs.apk_name }} \
|
||||||
|
--endpoint-url https://rustfs.uber-stup.club \
|
||||||
|
--no-verify-ssl
|
||||||
|
|
||||||
|
- name: Publish OTA update to Xavia
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
working-directory: omnex-plateform-app
|
||||||
|
env:
|
||||||
|
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
EXPO_PUBLIC_UPDATE_URL: ${{ secrets.XAVIA_API_URL }}/api/manifest
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=2048"
|
||||||
|
run: |
|
||||||
|
RUNTIME_VERSION=$(jq -r '.expo.runtimeVersion' app.json)
|
||||||
|
COMMIT_MESSAGE=$(git log -1 --pretty=%s ${{ github.sha }})
|
||||||
|
npx expo export --platform android --output-dir dist
|
||||||
|
jq '.expo' app.json > dist/expoconfig.json
|
||||||
|
cd dist && zip -r ../bundle.zip . && cd ..
|
||||||
|
curl -X POST "${{ secrets.XAVIA_API_URL }}/api/upload" \
|
||||||
|
-F "uploadKey=${{ secrets.XAVIA_UPLOAD_KEY }}" \
|
||||||
|
-F "file=@bundle.zip" \
|
||||||
|
-F "runtimeVersion=$RUNTIME_VERSION" \
|
||||||
|
-F "channel=${{ steps.config.outputs.channel }}" \
|
||||||
|
-F "commitHash=${{ github.sha }}" \
|
||||||
|
-F "commitMessage=$COMMIT_MESSAGE" \
|
||||||
|
--fail
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
name: Omnex Plateform Client - EAS Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "omnex-plateform-client/**"
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "omnex-plateform-client/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: omnex-plateform-client/package-lock.json
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
|
||||||
|
- name: Install EAS CLI & tooling
|
||||||
|
run: |
|
||||||
|
npm install -g eas-cli
|
||||||
|
pip install -r scripts/requirements.txt awscli --quiet
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
run: npx tsc --noEmit
|
||||||
|
|
||||||
|
- name: Determine config
|
||||||
|
id: config
|
||||||
|
run: |
|
||||||
|
echo "profile=production" >> $GITHUB_OUTPUT
|
||||||
|
echo "channel=production-omnex-client" >> $GITHUB_OUTPUT
|
||||||
|
echo "apk_name=omnex-plateform-client-production-$(date +%Y%m%d-%H%M).apk" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Inject EAS project ID
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
run: |
|
||||||
|
jq '.expo.extra.eas.projectId = "${{ secrets.EXPO_PROJECT_ID_CLIENT }}"' app.json > app.tmp.json
|
||||||
|
mv app.tmp.json app.json
|
||||||
|
|
||||||
|
- name: Restore Gradle cache (RustFS)
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
S3_ENDPOINT: https://rustfs.uber-stup.club
|
||||||
|
S3_BUCKET: apk-builds
|
||||||
|
run: python scripts/eas_cache.py restore --app omnex-plateform-client
|
||||||
|
|
||||||
|
- name: Build APK (local)
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
env:
|
||||||
|
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
EXPO_PUBLIC_UPDATE_URL: ${{ secrets.XAVIA_API_URL }}/api/manifest
|
||||||
|
EAS_BUILD_NO_EXPO_GO_WARNING: true
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=2048"
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
|
||||||
|
JAVA_TOOL_OPTIONS: "-Xmx3g"
|
||||||
|
run: eas build --platform android --profile ${{ steps.config.outputs.profile }} --local --non-interactive
|
||||||
|
|
||||||
|
- name: Save Gradle cache (RustFS)
|
||||||
|
if: success() || failure()
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
S3_ENDPOINT: https://rustfs.uber-stup.club
|
||||||
|
S3_BUCKET: apk-builds
|
||||||
|
run: python scripts/eas_cache.py save --app omnex-plateform-client
|
||||||
|
|
||||||
|
- name: Rename & upload APK to RustFS
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: us-east-1
|
||||||
|
run: |
|
||||||
|
mv *.apk ${{ steps.config.outputs.apk_name }}
|
||||||
|
aws s3 cp ${{ steps.config.outputs.apk_name }} \
|
||||||
|
s3://apk-builds/${{ steps.config.outputs.profile }}/${{ steps.config.outputs.apk_name }} \
|
||||||
|
--endpoint-url https://rustfs.uber-stup.club \
|
||||||
|
--no-verify-ssl
|
||||||
|
|
||||||
|
- name: Publish OTA update to Xavia
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
working-directory: omnex-plateform-client
|
||||||
|
env:
|
||||||
|
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
EXPO_PUBLIC_UPDATE_URL: ${{ secrets.XAVIA_API_URL }}/api/manifest
|
||||||
|
NODE_OPTIONS: "--max-old-space-size=2048"
|
||||||
|
run: |
|
||||||
|
RUNTIME_VERSION=$(jq -r '.expo.runtimeVersion' app.json)
|
||||||
|
COMMIT_MESSAGE=$(git log -1 --pretty=%s ${{ github.sha }})
|
||||||
|
npx expo export --platform android --output-dir dist
|
||||||
|
jq '.expo' app.json > dist/expoconfig.json
|
||||||
|
cd dist && zip -r ../bundle.zip . && cd ..
|
||||||
|
curl -X POST "${{ secrets.XAVIA_API_URL }}/api/upload" \
|
||||||
|
-F "uploadKey=${{ secrets.XAVIA_UPLOAD_KEY }}" \
|
||||||
|
-F "file=@bundle.zip" \
|
||||||
|
-F "runtimeVersion=$RUNTIME_VERSION" \
|
||||||
|
-F "channel=${{ steps.config.outputs.channel }}" \
|
||||||
|
-F "commitHash=${{ github.sha }}" \
|
||||||
|
-F "commitMessage=$COMMIT_MESSAGE" \
|
||||||
|
--fail
|
||||||
Reference in New Issue
Block a user