mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 00:10:47 +00:00
Build signed apk on tag creation (#35)
* Create cd.yml * added artifact upload * fixed jobs sequence * moved upload to build job * jobs rename * keystore * Update cd.yml * macos runner * cd_dev * Update build.gradle
This commit is contained in:
parent
59e440dfd7
commit
8d1640447f
3 changed files with 65 additions and 48 deletions
42
.github/workflows/cd.yml
vendored
42
.github/workflows/cd.yml
vendored
|
@ -1,42 +0,0 @@
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
name: Build app-dev-release.apk
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "cd" ]
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: "stable"
|
|
||||||
|
|
||||||
- name: Check flutter version
|
|
||||||
run: flutter --version
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
- name: Generate intl
|
|
||||||
run: flutter pub run intl_utils:generate
|
|
||||||
|
|
||||||
- name: Analyze project source
|
|
||||||
run: flutter analyze
|
|
||||||
|
|
||||||
- name: Build Apk
|
|
||||||
run: flutter build apk --flavor dev --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_dev.dart
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: m3_lightmeter.apk
|
|
||||||
path: build/app/outputs/flutter-apk/app-dev-release.apk
|
|
56
.github/workflows/cd_dev.yml
vendored
Normal file
56
.github/workflows/cd_dev.yml
vendored
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
name: Build app-dev-release.apk
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["cd"]
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-11
|
||||||
|
timeout-minutes: 30
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: "zulu"
|
||||||
|
java-version: "11"
|
||||||
|
|
||||||
|
- name: Restore Android keystore .jsk and .properties files
|
||||||
|
env:
|
||||||
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
||||||
|
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
||||||
|
run: |
|
||||||
|
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
|
||||||
|
echo -n "$KEYSTORE" | base64 --decode --output $KEYSTORE_PATH
|
||||||
|
cp $KEYSTORE_PATH ./android/app
|
||||||
|
KEYSTORE_PROPERTIES_PATH=$RUNNER_TEMP/key.properties
|
||||||
|
echo -n "$KEYSTORE_PROPERTIES" | base64 --decode --output $KEYSTORE_PROPERTIES_PATH
|
||||||
|
cp $KEYSTORE_PROPERTIES_PATH ./android
|
||||||
|
|
||||||
|
- name: Install Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "stable"
|
||||||
|
|
||||||
|
- name: Prepare flutter project
|
||||||
|
run: |
|
||||||
|
flutter --version
|
||||||
|
flutter pub get
|
||||||
|
flutter pub run intl_utils:generate
|
||||||
|
|
||||||
|
- name: Build Apk
|
||||||
|
run: flutter build apk --release --flavor dev --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_dev.dart
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: m3_lightmeter.apk
|
||||||
|
path: build/app/outputs/flutter-apk/app-dev-release.apk
|
|
@ -21,6 +21,12 @@ if (flutterVersionName == null) {
|
||||||
flutterVersionName = '1.0'
|
flutterVersionName = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
@ -50,15 +56,12 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {}
|
|
||||||
/*
|
|
||||||
release {
|
release {
|
||||||
keyAlias keystoreProperties['keyAlias']
|
keyAlias keystoreProperties['keyAlias']
|
||||||
keyPassword keystoreProperties['keyPassword']
|
keyPassword keystoreProperties['keyPassword']
|
||||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||||
storePassword keystoreProperties['storePassword']
|
storePassword keystoreProperties['storePassword']
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "app"
|
flavorDimensions "app"
|
||||||
|
@ -66,12 +69,12 @@ android {
|
||||||
dev {
|
dev {
|
||||||
applicationId "com.vodemn.lightmeter.dev"
|
applicationId "com.vodemn.lightmeter.dev"
|
||||||
dimension "app"
|
dimension "app"
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
prod {
|
prod {
|
||||||
applicationId "com.vodemn.lightmeter"
|
applicationId "com.vodemn.lightmeter"
|
||||||
dimension "app"
|
dimension "app"
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +83,7 @@ android {
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.release
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue