Skip to content

Commit

Permalink
Skip deployment to F-Droid when beta option set
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
SailReal committed Apr 30, 2021
1 parent 1180f6c commit 0ce6ce3
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,31 @@ platform :android do |options|
}
)

FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "repo/Cryptomator.apk")

sh("cp -r metadata/android/ metadata/org.cryptomator/")
FileUtils.cp("metadata/org.cryptomator/en-US/changelogs/default.txt", "metadata/org.cryptomator/en-US/changelogs/#{version}.txt")
FileUtils.cp("metadata/org.cryptomator/de-DE/changelogs/default.txt", "metadata/org.cryptomator/de-DE/changelogs/#{version}.txt")
sh("fdroid update && fdroid rewritemeta")
sh("rm -r metadata/org.cryptomator/")

aws_s3(
bucket: ENV['S3_BUCKET'],
endpoint: ENV['S3_ENDPOINT'],
region: ENV['S3_REGION'],
access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
path: "android/fdroid",
folder: "fastlane/repo",
skip_html_upload: true,
apk: ''
)
if options[:beta]
puts "Skipping deployment to F-Droid cause there isn't currently a beta channel"
else
puts "Updating F-Droid"

FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "repo/Cryptomator.apk")

sh("cp -r metadata/android/ metadata/org.cryptomator/")
FileUtils.cp("metadata/org.cryptomator/en-US/changelogs/default.txt", "metadata/org.cryptomator/en-US/changelogs/#{version}.txt")
FileUtils.cp("metadata/org.cryptomator/de-DE/changelogs/default.txt", "metadata/org.cryptomator/de-DE/changelogs/#{version}.txt")
sh("fdroid update && fdroid rewritemeta")
sh("rm -r metadata/org.cryptomator/")

aws_s3(
bucket: ENV['S3_BUCKET'],
endpoint: ENV['S3_ENDPOINT'],
region: ENV['S3_REGION'],
access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
path: "android/fdroid",
folder: "fastlane/repo",
skip_html_upload: true,
apk: ''
)
end

FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk")
end
Expand Down

0 comments on commit 0ce6ce3

Please sign in to comment.