1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-13 04:04:25 +02:00
Files
openscale/fastlane/Fastfile

92 lines
2.6 KiB
Ruby

# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
opt_out_usage
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
# Add gradle get version name plugin
# fastlane add_plugin get_version_name
default_platform(:android)
platform :android do
versionName = get_version_name(
gradle_file_path:"android_app/app/build.gradle.kts",
ext_constant_name:"versionName"
)
versionCode = get_version_name(
gradle_file_path:"android_app/app/build.gradle.kts",
ext_constant_name:"versionCode"
)
desc "Generate openScale release version"
lane :release do |options|
gradle(
task: "clean",
project_dir: 'android_app/'
)
gradle(
task: "assemble",
project_dir: 'android_app/',
build_type: "Release"
)
end
desc "Generate openScale oss version"
lane :oss do |options|
gradle(
task: "clean",
project_dir: 'android_app/'
)
gradle(
task: "bundle",
project_dir: 'android_app/',
build_type: "oss"
)
end
desc "Deploy a new openScale oss version to Google Play"
lane :deployOSS do
gradle(
task: "clean",
project_dir: 'android_app/'
)
gradle(
task: "bundle",
project_dir: 'android_app/',
build_type: "oss"
)
upload_to_play_store(
package_name: "com.health.openscale.oss",
track: "production",
metadata_path: "fastlane/metadata/android/",
apk: "android_app/app/build/outputs/bundle/oss/openScale-#{versionName}-oss.apk"
)
end
desc "Deploy a new version to GitHub"
lane :deployGitHubRelease do
set_github_release(
repository_name: "oliexdev/openScale",
api_token: ENV["OLIEXDEV_GITHUB_API_TOKEN"],
name: "openScale #{versionName} release",
tag_name: "v#{versionName}",
description: (File.read("metadata/android/en-GB/changelogs/#{versionCode}.txt") rescue "No changelog provided"),
upload_assets: [ "android_app/app/build/outputs/apk/release/openScale-#{versionName}-release.apk" ]
)
end
end