feat: add preview ci (#11)
This commit is contained in:
parent
90b7351061
commit
73ba72eaf0
|
@ -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
app.json
29
app.json
|
@ -6,6 +6,7 @@
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"icon": "./assets/icon.png",
|
"icon": "./assets/icon.png",
|
||||||
"userInterfaceStyle": "light",
|
"userInterfaceStyle": "light",
|
||||||
|
"sdkVersion": "51.0.0",
|
||||||
"splash": {
|
"splash": {
|
||||||
"image": "./assets/splash.png",
|
"image": "./assets/splash.png",
|
||||||
"resizeMode": "contain",
|
"resizeMode": "contain",
|
||||||
|
@ -15,16 +16,36 @@
|
||||||
"**/*"
|
"**/*"
|
||||||
],
|
],
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true
|
"supportsTablet": true,
|
||||||
|
"bundleIdentifier": "org.casdoor.casdoorapp",
|
||||||
|
"buildNumber": "1.0.0"
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/adaptive-icon.png",
|
"foregroundImage": "./assets/adaptive-icon.png",
|
||||||
"backgroundColor": "#ffffff"
|
"backgroundColor": "#ffffff"
|
||||||
}
|
},
|
||||||
|
"package": "org.casdoor.casdoorapp",
|
||||||
|
"versionCode": 1
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"favicon": "./assets/favicon.png"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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": {}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue