refactor: enable CI only configuration

This commit is contained in:
Rainer Killinger
2022-02-18 11:43:57 +01:00
parent 8abd993667
commit 4b258234e0
6 changed files with 66 additions and 34 deletions

View File

@@ -1,2 +1,2 @@
json_key_file("../../playstore_api_key.json") # Don't Change
#json_key_file("../../playstore_api_key.json") # Don't Change
package_name ENV["ANDROID_PACKAGE_NAME"] || "de.anyschool.app.droid" # Don't Change

View File

@@ -14,6 +14,7 @@
# update_fastlane
require 'json'
require 'base64'
default_platform(:android)
@@ -22,16 +23,12 @@ playstore_track = "internal"
package_json = JSON.parse(File.read('../../package.json'))
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
lane :fetch_version_code do
current_version_code = google_play_track_version_codes(
package_name: ENV['ANDROID_PACKAGE_NAME'],
track: playstore_track,
json_key: '../../playstore_api_key.json'
json_key_data: ENV['ANDROID_API_KEY_CONTENT']
).max
end
@@ -40,9 +37,9 @@ platform :android do
tracks = ['production', 'beta', 'internal']
tracks.each do |t|
version_code_candidates += google_play_track_version_codes(
package_name: ENV['ANDROID_PACKAGE_NAME'],
package_name: ENV['ANDROID_PACKAGE_NAME'],
track: t,
json_key: '../../playstore_api_key.json'
json_key_data: Base64.decode64(ENV['ANDROID_API_KEY_CONTENT'])
)
end
current_version_code = version_code_candidates.compact.max
@@ -72,14 +69,14 @@ platform :android do
build
upload_to_play_store(
track: playstore_track,
json_key: '../../playstore_api_key.json',
json_key_data: Base64.decode64(ENV['ANDROID_API_KEY_CONTENT']),
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
desc "Deploy a new version to the Google Play"
desc "Submit a new version to the Google Play"
lane :release do
build
#upload_to_play_store(json_key: '../../playstore_api_key.json', skip_upload_metadata: true, skip_upload_images: true)

View File

@@ -17,10 +17,34 @@ require 'json'
default_platform(:ios)
current_build_number = 1
package_json = JSON.parse(File.read('../../../package.json'))
api_key = app_store_connect_api_key(
key_id: ENV['APPLE_API_KEY_ID'],
issuer_id: ENV['APPLE_API_KEY_ISSUER_ID'],
key_content: ENV['APPLE_API_KEY_CONTENT'],
is_key_content_base64: true,
duration: 1000,
in_house: false
)
platform :ios do
desc "Push a new release build to the App Store"
lane :fetch_highest_build_number do
build_number_candidates = [1]
build_number_candidates += latest_testflight_build_number(
version: package_json['version'],
initial_build_number: 1,
api_key: api_key
)
build_number_candidates += app_store_build_number(
version: package_json['version'],
initial_build_number: 1,
api_key: api_key
)
current_build_number = build_number_candidates.compact.max
end
lane :configure do
set_info_plist_value(
@@ -53,21 +77,31 @@ platform :ios do
version_number: package_json['version'],
xcodeproj: "App.xcodeproj"
)
fetch_highest_build_number
increment_build_number(
build_number: current_build_number + 1,
xcodeproj: "App.xcodeproj"
)
end
lane :build do
build_app(workspace: "App.xcworkspace", scheme: "App")
end
desc "Submit a new version to iOS App Store"
lane :release do
configure
build
#upload_to_app_store(skip_metadata: true, skip_screenshots: true)
#upload_to_app_store(skip_metadata: true, skip_screenshots: true, api_key: api_key)
end
desc "Submit a new version to Testflight"
lane :beta do
configure
build
upload_to_testflight(skip_submission: true)
upload_to_testflight(
skip_submission: true,
api_key: api_key
)
end
end