Commit da4e8b87 authored by Thomas Markiewicz's avatar Thomas Markiewicz
Browse files

Added CI/CD build integration

parent 83a87ff4
stages:
- playstore
variables:
LANG: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
before_script:
- bundle update
playstore:
tags:
- android
stage: playstore
script:
- bundle exec fastlane playstore
only:
- develop
- master
environment:
name: playstore
artifacts:
name: "one_playstore_$MAJOR.$MINOR.$PATCH-$CI_COMMIT_REF_NAME+$CI_PIPELINE_IID.apk"
paths:
- ./*.apk
expire_in: 4 weeks
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>librem-one-android</name>
<comment>Project librem-one-android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=
eclipse.preferences.version=1
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=..
eclipse.preferences.version=1
......@@ -10,14 +10,23 @@ android {
applicationId "sm.puri.librem.one"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode rootProject.ext.versionCodeProp
versionName rootProject.ext.versionNameProp
}
signingConfigs {
release {
storeFile file(project.hasProperty("RELEASE_STORE_FILE") ? RELEASE_STORE_FILE : "/dummy/path")
storePassword project.hasProperty("RELEASE_STORE_PASSWORD") ? RELEASE_STORE_PASSWORD : "dummy password"
keyAlias project.hasProperty("RELEASE_KEY_ALIAS") ? RELEASE_KEY_ALIAS : "dummy alias"
keyPassword project.hasProperty("RELEASE_KEY_PASSWORD") ? RELEASE_KEY_PASSWORD : "dummy password"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
......
......@@ -15,6 +15,16 @@ buildscript {
}
}
ext {
versionMajor = System.getenv("MAJOR") as Integer ?: 0
versionMinor = System.getenv("MINOR") as Integer ?: 0
versionPatch = System.getenv("PATCH") as Integer ?: 0
versionBuild = System.getenv("CI_PIPELINE_IID") as Integer ?: 0
versionCodeProp = 100000 + versionBuild
versionNameProp = String.valueOf(versionMajor) + "." + String.valueOf(versionMinor) + "." + String.valueOf(versionPatch)
buildNumberProp = "${versionBuild}"
}
allprojects {
repositories {
google()
......
json_key_file("/Users/gitlabrunner/Nextcloud/LibertyApps/PlayStore/secrets/api-6019011998585182423-754965-83a427df00b1.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("sm.puri.librem.one") # e.g. com.krausefx.app
default_platform(:android)
platform :android do
before_all do
ENV["RIOT_URL"] = "" # Webhool URL created in Riot
end
desc "Build and deploy a new version for PlayStore"
lane :playstore do
gradle(task: "clean")
gradle(
task: "assemble",
build_type: "Release",
print_command: true
)
file_path = lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
file_name = file_path.gsub(/\/.*\//,"")
target_filename = "one_playstore_" + ENV["MAJOR"] + "." + ENV["MINOR"] + "." + ENV["PATCH"] + "-" + ENV["CI_COMMIT_REF_NAME"] + "+" + ENV["CI_PIPELINE_IID"] + ".apk"
target_path = "../" + target_filename
sh "echo Copying " + file_name + " to: " + target_path
sh "cp " + file_path + " " + target_path
upload_to_play_store(
track: "internal"
)
end
desc "Build and deploy a new version to F-Droid"
lane :fdroid do
gradle(
task: "assemble",
build_type: "Release",
flavor: "appfdroid"
)
upload_to_play_store
end
after_all do |lane|
# This block is called only if the executed lane was successfull
end
error do |lane, exception|
if is_ci
# send a message to Riot room that includes exception.message
end
end
end
Initial app.
\ No newline at end of file
Librem One
\ No newline at end of file
Librem One
\ No newline at end of file
Librem One
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment