Browse Source

fastlane: Check some basic requirements before starting release phase 2

This prevents late crashes in some instances.

Of course, we should technically have a more structured way of handling dependencies, but this
is a simple improvement for now.

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
Álvaro Brey Vilas 3 years ago
parent
commit
edb1e9c369
1 changed files with 18 additions and 0 deletions
  1. 18 0
      fastlane/Fastfile

+ 18 - 0
fastlane/Fastfile

@@ -47,6 +47,7 @@ end
 
 desc "Release phase 2 for RC: checks, tag, upload gplay to playstore with values from build.gradle"
 lane :RC_releasePhase2 do |options|
+    checkReleaseRequirements_RC()
     info = androidVersion
     promptVersion(info)
     checkChangelog(info)
@@ -67,6 +68,7 @@ end
 
 desc "Release phase 2 for FINAL: checks, tag, upload gplay to playstore with values from build.gradle"
 lane :Final_releasePhase2 do |options|
+    checkReleaseRequirements_Final()
     info = androidVersion
     promptVersion(info)
     checkChangelog(info)
@@ -164,6 +166,22 @@ private_lane :build_for_screengrab do
     TEST_APK_LOCATION = lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].select{ |i| i[/androidTest/] }[0]
 end
 
+private_lane :checkReleaseRequirements_common do
+    sh("if ! command -v fdroid &>/dev/null; then echo 'fdroid command not found' ; exit 1 ;")
+end
+
+private_lane :checkReleaseRequirements_RC do
+    checkReleaseRequirements_common()
+    sh("if ! command -v fdroidMergeRequestRC &>/dev/null; then echo 'fdroidMergeRequestRC command not found'; exit 1;")
+    sh("if ! command -v createChangelogPullRequestRC &>/dev/null; then echo 'createChangelogPullRequestRC command not found'; exit 1;")
+end
+
+private_lane :checkReleaseRequirements_Final do
+    checkReleaseRequirements_common()
+    sh("if ! command -v fdroidMergeRequestFinal &>/dev/null; then echo 'fdroidMergeRequestFinal command not found'; exit 1;")
+    sh("if ! command -v createChangelogPullRequestFinal &>/dev/null; then echo 'createChangelogPullRequestFinal command not found'; exit 1;")
+end
+
 private_lane :createChangelogPullRequest_RC do |options|
     sh("createChangelogPullRequestRC " +  options["tag"] + " \"" + options["versionName"] + "\" " + options["versionCode"] + " \"" + options["branch"] + "\" ")
 end