Create APK's in deployToServer- and deployToFDroid-lane for GitHub

This commit is contained in:
Julian Raufelder 2021-02-16 15:07:26 +01:00
parent 2452ddb5a2
commit 0c3671e747
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -28,30 +28,16 @@ platform :android do |options|
FileUtils.cp(release_note_path_en, "metadata/android/fr-FR/changelogs/default.txt") FileUtils.cp(release_note_path_en, "metadata/android/fr-FR/changelogs/default.txt")
deployToPlaystore(beta:options[:beta]) deployToPlaystore(beta:options[:beta])
deployToServer(beta:options[:beta])
deployToFDroid(beta:options[:beta])
if options[:beta] slack(
puts "Skipping deployment to server cause there isn't currently a beta channel" default_payloads: [], # reduce the notification to the minimum
message: ":rocket: Successfully deployed #{version} with code #{build} to the Play Store :cryptomator:",
slack( payload: {
default_payloads: [], # reduce the notification to the minimum "Changes" => File.read(release_note_path_en)
message: ":rocket: Successfully deployed #{version} with code #{build} to the Play Store :cryptomator:", }
payload: { )
"Changes" => File.read(release_note_path_en)
}
)
else
deployToServer(beta:options[:beta])
deployToFDroid(beta:options[:beta])
slack(
default_payloads: [], # reduce the notification to the minimum
message: ":rocket: Successfully deployed #{version} with code #{build} to the Play Store and APK store :cryptomator:",
payload: {
"Changes" => File.read(release_note_path_en)
}
)
end
end end
desc "Deploy new version to Play Store" desc "Deploy new version to Play Store"
@ -134,39 +120,43 @@ platform :android do |options|
latest_version_jsn.write(token) latest_version_jsn.write(token)
latest_version_jsn.close latest_version_jsn.close
puts "Uploading APK and release note" if options[:beta]
puts "Skipping deployment to server cause there isn't currently a beta channel"
else
puts "Uploading APK and release note"
aws_s3( aws_s3(
bucket: ENV['S3_BUCKET'], bucket: ENV['S3_BUCKET'],
endpoint: ENV['S3_ENDPOINT'], endpoint: ENV['S3_ENDPOINT'],
region: ENV['S3_REGION'], region: ENV['S3_REGION'],
access_key: ENV['S3_ACCESS_KEY'], access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'], secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
path: "android/#{version}", path: "android/#{version}",
files: [ files: [
"fastlane/release/Cryptomator-#{version}.apk", "fastlane/release/Cryptomator-#{version}.apk",
"fastlane/release-notes.html" "fastlane/release-notes.html"
], ],
skip_html_upload: true, skip_html_upload: true,
apk: '' apk: ''
) )
puts "Uploading #{latest_version_filename} with claims #{claims}" puts "Uploading #{latest_version_filename} with claims #{claims}"
puts "Rename #{latest_version_filename} to latest-version.json for deployment" puts "Rename #{latest_version_filename} to latest-version.json for deployment"
aws_s3( aws_s3(
bucket: ENV['S3_BUCKET'], bucket: ENV['S3_BUCKET'],
endpoint: ENV['S3_ENDPOINT'], endpoint: ENV['S3_ENDPOINT'],
region: ENV['S3_REGION'], region: ENV['S3_REGION'],
access_key: ENV['S3_ACCESS_KEY'], access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'], secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
path: "android", path: "android",
files: [ files: [
"fastlane/latest_versions/#{latest_version_filename}" "fastlane/latest_versions/#{latest_version_filename}"
], ],
skip_html_upload: true, skip_html_upload: true,
apk: '' apk: ''
) )
end
FileUtils.mv("release/Cryptomator-#{version}.apk", "release/Cryptomator-#{version}_signed.apk") FileUtils.mv("release/Cryptomator-#{version}.apk", "release/Cryptomator-#{version}_signed.apk")
end end
@ -190,12 +180,4 @@ platform :android do |options|
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk") FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk")
end end
after_all do |lane|
#error do |lane, exception|
# slack(
# message: exception.message,
# success:false
# )
end
end end