mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 10:03:31 +00:00
Merge branch 'codemagic-setup' of gitlab.com:mysocialportal/relatica into circle-vs-channel-awareness
This commit is contained in:
commit
9dd2af915a
2 changed files with 75 additions and 3 deletions
|
@ -13,12 +13,18 @@ if (flutterRoot == null) {
|
|||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
flutterVersionCode = '3'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
flutterVersionName = '0.9.0'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
@ -53,11 +59,27 @@ android {
|
|||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
|
||||
storeFile file(System.getenv()["CM_KEYSTORE_PATH"])
|
||||
storePassword System.getenv()["CM_KEYSTORE_PASSWORD"]
|
||||
keyAlias System.getenv()["CM_KEY_ALIAS"]
|
||||
keyPassword System.getenv()["CM_KEY_PASSWORD"]
|
||||
} else {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
50
codemagic.yaml
Normal file
50
codemagic.yaml
Normal file
|
@ -0,0 +1,50 @@
|
|||
workflows:
|
||||
android-workflow:
|
||||
name: Android Workflow
|
||||
instance_type: mac_mini_m1
|
||||
max_build_duration: 120
|
||||
environment:
|
||||
android_signing:
|
||||
- codemagickeystore
|
||||
groups:
|
||||
- google_play # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS)
|
||||
vars:
|
||||
PACKAGE_NAME: "social.myportal.relatica" # <-- Put your package name here
|
||||
GOOGLE_PLAY_TRACK: "internal"
|
||||
flutter: stable
|
||||
scripts:
|
||||
- name: Set up local.properties
|
||||
script: |
|
||||
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
|
||||
- name: Get Flutter packages
|
||||
script: |
|
||||
flutter packages pub get
|
||||
# - name: Flutter analyze
|
||||
# script: |
|
||||
# flutter analyze
|
||||
# ignore_failure: true
|
||||
- name: Flutter unit tests
|
||||
script: |
|
||||
flutter test
|
||||
ignore_failure: true
|
||||
- name: Build AAB with Flutter
|
||||
script: |
|
||||
BUILD_NUMBER=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks="$GOOGLE_PLAY_TRACK") + 1))
|
||||
flutter build appbundle --release \
|
||||
--build-name=0.9.0 \
|
||||
--build-number=$PROJECT_BUILD_NUMBER
|
||||
artifacts:
|
||||
- build/**/outputs/**/*.aab
|
||||
- build/**/outputs/**/mapping.txt
|
||||
- flutter_drive.log
|
||||
publishing:
|
||||
email:
|
||||
recipients:
|
||||
- codemagic@myportal.social
|
||||
notify:
|
||||
success: true
|
||||
failure: false
|
||||
google_play:
|
||||
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
|
||||
track: $GOOGLE_PLAY_TRACK
|
||||
submit_as_draft: true
|
Loading…
Reference in a new issue