Skip to content

Commit

Permalink
WIP: Reorganize build/release pipelines
Browse files Browse the repository at this point in the history
Part of #6830

Co-authored-by: paw <[email protected]>
  • Loading branch information
hrb-hub and paw-hub committed Nov 19, 2024
1 parent 19cfae1 commit 1483d84
Show file tree
Hide file tree
Showing 9 changed files with 737 additions and 290 deletions.
28 changes: 16 additions & 12 deletions app-ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
default_platform(:ios)

platform :ios do
desc "Push a new prod release to AppStore"
lane :appstore_prod do |options|
desc "Build a new Mail prod release with AppStore configuration"
lane :build_mail_prod do |options|
match(
app_identifier: ["de.tutao.tutanota", "de.tutao.tutanota.TutanotaShareExtension", "de.tutao.tutanota.TutanotaNotificationExtension"],
type: "appstore",
Expand All @@ -37,18 +37,22 @@ platform :ios do
include_symbols: true,
verbose: true
)
if options[:submit]
upload_to_app_store(
skip_screenshots: true,
submit_for_review: false,
precheck_include_in_app_purchases: false,
# must use force as long as we don't automatically create html previews
force: true,
api_key_path: ENV["API_KEY_JSON_FILE_PATH"]
)
end
end

desc "Publish a Mail artifact to AppStore"
lane :publish_mail_prod do |options|
sh 'echo "Uploading mail artifact ' + options[:file] + '"'

upload_to_app_store(
skip_screenshots: true,
submit_for_review: false,
precheck_include_in_app_purchases: false,
# must use force as long as we don't automatically create html previews
force: true,
api_key_path: ENV["API_KEY_JSON_FILE_PATH"]
)
end

desc "Build a new prod release for ad-hoc"
lane :adhoc_prod do |options|
match(
Expand Down
69 changes: 1 addition & 68 deletions ci/Android.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pipeline {
PATH = "${env.NODE_PATH}:${env.PATH}:/home/jenkins/emsdk/upstream/bin/:/home/jenkins/emsdk/:/home/jenkins/emsdk/upstream/emscripten"
ANDROID_SDK_ROOT = "/opt/android-sdk-linux"
ANDROID_HOME = "/opt/android-sdk-linux"
GITHUB_RELEASE_PAGE = "https://github.com/tutao/tutanota/releases/tag/tutanota-android-release-${VERSION}"
}

agent {
Expand All @@ -19,15 +18,8 @@ pipeline {
parameters {
booleanParam(
name: 'RELEASE', defaultValue: false,
description: "Build a test and release version of the app. " +
"Uploads both to Nexus and creates a new release on google play, " +
"which must be manually published from play.google.com/console"
description: "Build a test and release version of the app. Uploads both to Nexus."
)
persistentText(
name: "releaseNotes",
defaultValue: "",
description: "release notes for this build"
)
}

stages {
Expand Down Expand Up @@ -124,26 +116,6 @@ pipeline {
assetFilePath: "${WORKSPACE}/build/app-android/tutanota-app-tutao-releaseTest-${VERSION}.apk",
fileExtension: 'apk'
)

catchError(stageResult: 'UNSTABLE', buildResult: 'SUCCESS', message: 'Failed to upload android test app to Play Store') {
// This doesn't publish to the main app on play store,
// instead it gets published to the hidden "tutanota-test" app
// this happens because the AppId is set to de.tutao.tutanota.test by the android build
// and play store knows which app to publish just based on the id
androidApkUpload(
googleCredentialsId: 'android-app-publisher-credentials',
apkFilesPattern: "build/app-android/tutanota-app-tutao-releaseTest-${VERSION}.apk",
trackName: 'internal',
rolloutPercentage: '100%',
recentChangeList: [
[
language: "en-US",
text : "see: ${GITHUB_RELEASE_PAGE}"
]
]
) // androidApkUpload
} // catchError

}
}
} // stage testing
Expand All @@ -163,49 +135,10 @@ pipeline {
assetFilePath: "${WORKSPACE}/${filePath}",
fileExtension: 'apk'
)

androidApkUpload(
googleCredentialsId: 'android-app-publisher-credentials',
apkFilesPattern: "${filePath}",
trackName: 'production',
// Don't publish the app to users directly
// It will require manual intervention at play.google.com/console
rolloutPercentage: '0%',
recentChangeList: [
[
language: "en-US",
text : "see: ${GITHUB_RELEASE_PAGE}"
]
]
)
}
}
} // stage production
}
}
stage('Tag and publish release page') {
when {
expression { return params.RELEASE }
}
steps {
// Needed to upload it
unstash 'apk-production'

script {
def filePath = "build/app-android/tutanota-app-tutao-release-${VERSION}.apk"

writeFile file: "notes.txt", text: params.releaseNotes
catchError(stageResult: 'UNSTABLE', buildResult: 'SUCCESS', message: 'Failed to create github release page for android') {
withCredentials([string(credentialsId: 'github-access-token', variable: 'GITHUB_TOKEN')]) {
sh """node buildSrc/createReleaseDraft.js --name '${VERSION} (Android)' \
--tag 'tutanota-android-release-${VERSION}' \
--uploadFile '${WORKSPACE}/${filePath}' \
--notes notes.txt"""
} // withCredentials
} // catchError
sh "rm notes.txt"
} // script
}
}
}
}
Loading

0 comments on commit 1483d84

Please sign in to comment.