Change android signing
This commit is contained in:
45
.github/workflows/build.yml
vendored
45
.github/workflows/build.yml
vendored
@@ -4,12 +4,12 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- 'v*'
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- '**.md'
|
||||||
- "docs/**"
|
- 'docs/**'
|
||||||
- ".github/**"
|
- '.github/**'
|
||||||
- "!.github/workflows/build.yml"
|
- '!.github/workflows/build.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -64,15 +64,15 @@ jobs:
|
|||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: "3.13.x"
|
flutter-version: '3.13.x'
|
||||||
channel: "stable"
|
channel: 'stable'
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
if: startsWith(matrix.platform,'android')
|
if: startsWith(matrix.platform,'android')
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: "zulu"
|
distribution: 'zulu'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Setup Flutter Distributor
|
- name: Setup Flutter Distributor
|
||||||
@@ -114,23 +114,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Signing Properties
|
- name: Setup Signing Properties
|
||||||
if: startsWith(matrix.platform,'android')
|
if: startsWith(matrix.platform,'android')
|
||||||
env:
|
|
||||||
ANDROID_SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
|
|
||||||
ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
|
|
||||||
ANDROID_SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
|
|
||||||
ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }}
|
|
||||||
run: |
|
run: |
|
||||||
cd android
|
echo "${{ secrets.ANDROID_SIGNING_KEY }}" | base64 --decode > android/key.jks
|
||||||
pwd
|
echo "storeFile=$(pwd)/android/key.jks" > android/key.properties
|
||||||
touch signing.properties
|
echo "storePassword=${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}" >> android/key.properties
|
||||||
echo $ANDROID_SIGNING_KEY | base64 -d > release.keystore
|
echo "keyPassword=${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}" >> android/key.properties
|
||||||
echo "keystore.path=release.keystore" > release.properties
|
echo "keyAlias=${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}" >> android/key.properties
|
||||||
echo keystore.password="$ANDROID_SIGNING_STORE_PASSWORD" >> release.properties
|
|
||||||
echo key.alias="$ANDROID_SIGNING_KEY_ALIAS" >> release.properties
|
|
||||||
echo key.password="$ANDROID_SIGNING_KEY_PASSWORD" >> release.properties
|
|
||||||
cp release.* app/
|
|
||||||
cat release.properties
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Release ${{ matrix.platform }}
|
- name: Release ${{ matrix.platform }}
|
||||||
env:
|
env:
|
||||||
@@ -258,7 +247,7 @@ jobs:
|
|||||||
uses: 8Mi-Tech/delete-release-assets-action@main
|
uses: 8Mi-Tech/delete-release-assets-action@main
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: "draft"
|
tag: 'draft'
|
||||||
deleteOnlyFromDrafts: false
|
deleteOnlyFromDrafts: false
|
||||||
|
|
||||||
- name: Create or Update Draft Release
|
- name: Create or Update Draft Release
|
||||||
@@ -268,8 +257,8 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
files: ./out/*
|
files: ./out/*
|
||||||
name: "draft"
|
name: 'draft'
|
||||||
tag_name: "draft"
|
tag_name: 'draft'
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
upload-release:
|
upload-release:
|
||||||
@@ -309,7 +298,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
prerelease: ${{ env.CHANNEL == 'dev' }}
|
prerelease: ${{ env.CHANNEL == 'dev' }}
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ github.ref_name }}
|
||||||
body_path: "./release.md"
|
body_path: './release.md'
|
||||||
files: ./out/*
|
files: ./out/*
|
||||||
|
|
||||||
- name: Create service_account.json
|
- name: Create service_account.json
|
||||||
|
|||||||
@@ -11,6 +11,24 @@ if (flutterRoot == null) {
|
|||||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasKeyStore = false
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
hasKeyStore = true
|
||||||
|
} else {
|
||||||
|
println "+++"
|
||||||
|
println "No keystore defined. The app will not be signed."
|
||||||
|
println "Create a android/key.properties file with the following properties:"
|
||||||
|
println "storePassword"
|
||||||
|
println "keyPassword"
|
||||||
|
println "keyAlias"
|
||||||
|
println "storeFile"
|
||||||
|
println "+++"
|
||||||
|
}
|
||||||
|
|
||||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
if (flutterVersionCode == null) {
|
if (flutterVersionCode == null) {
|
||||||
flutterVersionCode = '1'
|
flutterVersionCode = '1'
|
||||||
@@ -21,11 +39,6 @@ if (flutterVersionName == null) {
|
|||||||
flutterVersionName = '1.0'
|
flutterVersionName = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
|
||||||
def keystorePropertiesFile = rootProject.file('release.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"
|
||||||
@@ -61,24 +74,33 @@ android {
|
|||||||
abi {
|
abi {
|
||||||
enable true
|
enable true
|
||||||
reset()
|
reset()
|
||||||
|
//noinspection ChromeOsAbiSupport
|
||||||
include "x86_64", "armeabi-v7a", "arm64-v8a"
|
include "x86_64", "armeabi-v7a", "arm64-v8a"
|
||||||
|
|
||||||
universalApk true
|
universalApk true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasKeyStore) {
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
keyAlias keystoreProperties['key.alias']
|
keyAlias keystoreProperties['keyAlias']
|
||||||
keyPassword keystoreProperties['key.password']
|
keyPassword keystoreProperties['keyPassword']
|
||||||
storeFile keystoreProperties['keystore.path'] ? file(keystoreProperties['keystore.path']) : null
|
storeFile file(keystoreProperties['storeFile'])
|
||||||
storePassword keystoreProperties['keystore.password']
|
storePassword keystoreProperties['storePassword']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
if (hasKeyStore) {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
} else {
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
|
}
|
||||||
ndk {
|
ndk {
|
||||||
|
//noinspection ChromeOsAbiSupport
|
||||||
abiFilters "x86_64", "armeabi-v7a", "arm64-v8a"
|
abiFilters "x86_64", "armeabi-v7a", "arm64-v8a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user