forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.ps1
More file actions
29 lines (26 loc) · 950 Bytes
/
Copy pathrelease.ps1
File metadata and controls
29 lines (26 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$ErrorActionPreference = "Stop"
$AppDir = (Resolve-Path (Join-Path $PSScriptRoot "../..")).Path
Set-Location $AppDir
$EnvFile = Join-Path $AppDir ".env"
if (-not (Test-Path $EnvFile)) {
throw "Missing .env; prepare the mobile beta environment before releasing."
}
$EnvSettings = @{}
Get-Content $EnvFile | ForEach-Object {
if ($_ -match '^([^#][^=]*)=(.*)$') {
$EnvSettings[$Matches[1]] = $Matches[2]
}
}
foreach ($Key in @("USE_WEB_AUTH", "USE_AUTH_CUSTOM_TOKEN")) {
if ($EnvSettings[$Key] -ne "true") {
throw ".env must contain $Key=true for the prod/mobile_beta release."
}
}
$Profile = "mobile_beta"
flutter clean
flutter pub get
dart run build_runner build --delete-conflicting-outputs
flutter build appbundle --release --flavor prod -t lib/main_prod.dart `
--dart-define=OMI_APP_PROFILE=$Profile
flutter build apk --release --flavor prod -t lib/main_prod.dart `
--dart-define=OMI_APP_PROFILE=$Profile