mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-07-12 08:58:46 +00:00
Fixed CI/CD.
This commit is contained in:
parent
9880a5810d
commit
c4491d195b
3 changed files with 21 additions and 14 deletions
2
.gitlab-ci.yml
Normal file
2
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
include:
|
||||||
|
- local: 'receivers/android/.gitlab-ci.yml'
|
|
@ -1,13 +1,19 @@
|
||||||
stages:
|
stages:
|
||||||
- buildAndDeployApk
|
- buildAndDeployApk
|
||||||
|
|
||||||
|
variables:
|
||||||
|
ANDROID_VERSION_NAME:
|
||||||
|
value: ""
|
||||||
|
description: "Enter the version name here (e.g. 1.0.1)."
|
||||||
|
ANDROID_VERSION_CODE:
|
||||||
|
value: ""
|
||||||
|
description: "Enter the version code here (e.g. 1)."
|
||||||
|
|
||||||
buildAndDeployApk:
|
buildAndDeployApk:
|
||||||
stage: buildAndDeployApk
|
stage: buildAndDeployApk
|
||||||
script:
|
script:
|
||||||
- ./gradlew --stacktrace assembleRelease
|
- if [ -z "$ANDROID_VERSION_NAME" ] || [ -z "$ANDROID_VERSION_CODE" ]; then echo "Version name or code not specified. Skipping build."; exit 0; fi
|
||||||
|
- ./receivers/android/gradlew --stacktrace assembleRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
||||||
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
|
||||||
- git describe --tags > /var/www/html/fcast-version.txt
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
|
||||||
only:
|
when: manual
|
||||||
- tags
|
|
||||||
except:
|
|
||||||
- branches
|
|
||||||
|
|
|
@ -2,16 +2,15 @@ plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10'
|
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10'
|
||||||
id 'org.ajoberstar.grgit' version '1.7.2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
gitVersionName = grgit.describe()
|
currentVersionName = project.hasProperty('versionName') ? project.property('versionName') : '1.0.0'
|
||||||
gitVersionCode = gitVersionName != null && gitVersionName.isInteger() ? gitVersionName.toInteger() : 1
|
currentVersionCode = project.hasProperty('versionCode') ? Integer.parseInt(project.property('versionCode')) : 1
|
||||||
}
|
}
|
||||||
|
|
||||||
println("Version Name: $gitVersionName")
|
println("Version Name: $currentVersionName")
|
||||||
println("Version Code: $gitVersionCode")
|
println("Version Code: $currentVersionCode")
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
def keystoreProperties = new Properties()
|
||||||
def keystorePropertiesFile = rootProject.file('/opt/key.properties')
|
def keystorePropertiesFile = rootProject.file('/opt/key.properties')
|
||||||
|
@ -27,8 +26,8 @@ android {
|
||||||
applicationId "com.futo.fcast.receiver"
|
applicationId "com.futo.fcast.receiver"
|
||||||
minSdk 24
|
minSdk 24
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode gitVersionCode
|
versionCode currentVersionCode
|
||||||
versionName gitVersionName
|
versionName currentVersionName
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue