Skip to content

Commit

Permalink
feat: add preview ci (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
IZUMI-Zu authored Jul 31, 2024
1 parent 90b7351 commit 73ba72e
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build preview for pull requests

on:
push:
branches: [master]
pull_request:
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'master' || github.run_id }}
permissions:
pull-requests: write
actions: write
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Install dependencies
run: npm install

- name: 🚀 Create preview
if: ${{ github.event_name == 'pull_request' }}
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
comment: true
qr-target: 'expo-go'
working-directory: ${{ github.workspace }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Create preview builds if needed
uses: expo/expo-github-action/preview-build@main
with:
command: eas build --profile development --platform all
29 changes: 25 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"sdkVersion": "51.0.0",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
Expand All @@ -15,16 +16,36 @@
"**/*"
],
"ios": {
"supportsTablet": true
"supportsTablet": true,
"bundleIdentifier": "org.casdoor.casdoorapp",
"buildNumber": "1.0.0"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"package": "org.casdoor.casdoorapp",
"versionCode": 1
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"extra": {
"eas": {
"projectId": "c02d2dfe-dd43-46ff-8a3e-e384fbc95b1d"
}
},
"plugins": [
[
"expo-camera",
{
"cameraPermission": "Allow $(PRODUCT_NAME) to access your camera",
"microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone",
"recordAudioAndroid": true
}
]
],
"owner": "hsluoyz"
}
}
}
45 changes: 45 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"cli": {
"version": ">= 10.2.1"
},
"build": {
"base": {
"android": {
"image": "latest",
"buildType": "apk"
},
"ios": {
"image": "latest",
"simulator": true
}
},
"development": {
"extends": "base",
"channel": "development",
"developmentClient": true,
"distribution": "internal",
"android": {
"withoutCredentials": true
},
"ios": {
"buildConfiguration": "Debug"
}
},
"preview": {
"extends": "base",
"channel": "preview",
"distribution": "internal",
"ios": {
"simulator": true
}
},
"production": {
"extends": "base",
"channel": "production",
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}

0 comments on commit 73ba72e

Please sign in to comment.