Remove usage of Buildkite.

Build number is just removed.
Related script will need to be updated separately.
This commit is contained in:
Benoit Marty 2022-11-14 15:02:01 +01:00 committed by Benoit Marty
parent ae996ae197
commit 9ca7415f5a
18 changed files with 26 additions and 51 deletions

View File

@ -1,4 +1,4 @@
[![Buildkite](https://badge.buildkite.com/ad0065c1b70f557cd3b1d3d68f9c2154010f83c4d6f71706a9.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-android/builds?branch=develop)
[![Latest build](https://github.com/vector-im/element-android/actions/workflows/build.yml/badge.svg?query=branch%3Adevelop)](https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%3Adevelop)
[![Weblate](https://translate.element.io/widgets/element-android/-/svg-badge.svg)](https://translate.element.io/engage/element-android/?utm_source=widget)
[![Element Android Matrix room #element-android:matrix.org](https://img.shields.io/matrix/element-android:matrix.org.svg?label=%23element-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-android:matrix.org)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-android&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vector-im_element-android)
@ -14,7 +14,7 @@ It is a total rewrite of [Riot-Android](https://github.com/vector-im/riot-androi
[<img src="resources/img/google-play-badge.png" alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=im.vector.app)
[<img src="resources/img/f-droid-badge.png" alt="Get it on F-Droid" height="60">](https://f-droid.org/app/im.vector.app)
Nightly build: [![Buildkite](https://badge.buildkite.com/ad0065c1b70f557cd3b1d3d68f9c2154010f83c4d6f71706a9.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-android/builds?branch=develop) Nightly test status: [![allScreensTest](https://github.com/vector-im/element-android/actions/workflows/nightly.yml/badge.svg)](https://github.com/vector-im/element-android/actions/workflows/nightly.yml)
Build of develop branch: [![GitHub Action](https://github.com/vector-im/element-android/actions/workflows/build.yml/badge.svg?query=branch%3Adevelop)](https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%3Adevelop) Nightly test status: [![allScreensTest](https://github.com/vector-im/element-android/actions/workflows/nightly.yml/badge.svg)](https://github.com/vector-im/element-android/actions/workflows/nightly.yml)
# New Android SDK
@ -40,7 +40,7 @@ If you would like to receive releases more quickly (bearing in mind that they ma
1. [Sign up to receive beta releases](https://play.google.com/apps/testing/im.vector.app) via the Google Play Store.
2. Install a [release APK](https://github.com/vector-im/element-android/releases) directly - download the relevant .apk file and allow installing from untrusted sources in your device settings. Note: these releases are the Google Play version, which depend on some Google services. If you prefer to avoid that, try the latest dev builds, and choose the F-Droid version.
3. If you're really brave, install the [very latest dev build](https://buildkite.com/matrix-dot-org/element-android/builds/latest?branch=develop&state=passed) - click on *Assemble (GPlay or FDroid) Debug version* then on *Artifacts*.
3. If you're really brave, install the [very latest dev build](https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%3Adevelop) - pick a build, then click on `Summary` to download the APKs from there: `vector-Fdroid-debug` and `vector-Gplay-debug` contains the APK for the desired store. Each file contains 5 APKs. 4 APKs for every supported specific architecture of device. In doubt you can install the `universal` APK.
## Contributing

View File

@ -1,6 +1,6 @@
// Default configuration copied from https://runningcode.github.io/gradle-doctor/configuration/
def isCiBuild = System.env.BUILDKITE == "true" || System.env.GITHUB_ACTIONS == "true"
def isCiBuild = System.env.GITHUB_ACTIONS == "true"
println "Is CI build: $isCiBuild"
doctor {

View File

@ -3,6 +3,9 @@
# Exit on any error
set -e
echo "Sorry, this script needs to be updated to download APKs from GitHub action. Buildkite is not building APKs anymore."
exit 1
if [[ "$#" -ne 1 ]]; then
echo "Usage: $0 BUILDKITE_TOKEN" >&2
exit 1

View File

@ -31,6 +31,10 @@ PIPELINE_SLUG = "element-android"
### Arguments
print("Sorry, this script needs to be updated to download APKs from GitHub action. Buildkite is not building APKs anymore.")
exit(1)
parser = argparse.ArgumentParser(description='Download artifacts from Buildkite.')
parser.add_argument('-t',
'--token',

View File

@ -214,7 +214,7 @@ else
fi
printf "\n================================================================================\n"
read -p "Wait for Buildkite https://buildkite.com/matrix-dot-org/element-android/builds?branch=main to build the 'main' branch. Press enter when it's done."
read -p "Wait for the GitHub action https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%3Amain to build the 'main' branch. Press enter when it's done."
printf "\n================================================================================\n"
printf "Running the release script...\n"

View File

@ -76,16 +76,9 @@ static def gitRevisionDate() {
}
static def gitBranchName() {
def fromEnv = System.env.BUILDKITE_BRANCH as String ?: ""
if (!fromEnv.isEmpty()) {
return fromEnv
} else {
// Note: this command return "HEAD" on Buildkite, so use the system env 'BUILDKITE_BRANCH' content first
def cmd = "git rev-parse --abbrev-ref HEAD"
return cmd.execute().text.trim()
}
}
// For Google Play build, build on any other branch than main will have a "-dev" suffix
static def getGplayVersionSuffix() {
@ -122,8 +115,6 @@ project.android.buildTypes.all { buildType ->
// 64 bits have greater value than 32 bits
ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].withDefault { 0 }
def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0
android {
namespace "im.vector.application"
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
@ -155,7 +146,6 @@ android {
buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""
buildConfigField "String", "GIT_REVISION_DATE", "\"${gitRevisionDate()}\""
buildConfigField "String", "GIT_BRANCH_NAME", "\"${gitBranchName()}\""
buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -1,10 +1,6 @@
## Debug signature
Buildkite CI tool uses docker images to build the Android application, and it looks like the debug signature is changed at each build.
So it's not possible for user to upgrade the application with the last build from buildkite without uninstalling the application.
This folder contains a debug signature, and the debug build will uses this signature to build the APK.
The validity of the signature is 30 years. So it has to be replaced before June 2049 :).

View File

@ -239,7 +239,7 @@ class VectorApplication :
}
private fun logInfo() {
val appVersion = versionProvider.getVersion(longFormat = true, useBuildNumber = true)
val appVersion = versionProvider.getVersion(longFormat = true)
val sdkVersion = Matrix.getSdkVersion()
val date = SimpleDateFormat("MM-dd HH:mm:ss.SSSZ", Locale.US).format(Date())

View File

@ -221,7 +221,6 @@ import javax.inject.Singleton
gitRevision = BuildConfig.GIT_REVISION,
gitRevisionDate = BuildConfig.GIT_REVISION_DATE,
gitBranchName = BuildConfig.GIT_BRANCH_NAME,
buildNumber = BuildConfig.BUILD_NUMBER,
flavorDescription = BuildConfig.FLAVOR_DESCRIPTION,
flavorShortDescription = BuildConfig.SHORT_FLAVOR_DESCRIPTION,
)

View File

@ -117,7 +117,7 @@
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize" />
<!-- Add tools:ignore="Instantiatable" for the error reported only by Buildkite :/ -->
<!-- Add tools:ignore="Instantiatable" for the error reported only by CI :/ -->
<activity
android:name=".features.media.VectorAttachmentViewerActivity"
android:theme="@style/Theme.Vector.Black.Transparent"
@ -337,7 +337,7 @@
</intent-filter>
</service>
<!-- Add tools:ignore="Instantiatable" for the error reported only by Buildkite and for lintGplayRelease check :/ -->
<!-- Add tools:ignore="Instantiatable" for the error reported only by CI and for lintGplayRelease check :/ -->
<service
android:name=".core.services.VectorSyncAndroidService"
android:exported="false"

View File

@ -24,7 +24,6 @@ data class BuildMeta(
val gitRevision: String,
val gitRevisionDate: String,
val gitBranchName: String,
val buildNumber: String,
val flavorDescription: String,
val flavorShortDescription: String,
)

View File

@ -65,8 +65,7 @@ class LoginSplashFragment :
views.loginSplashVersion.isVisible = true
@SuppressLint("SetTextI18n")
views.loginSplashVersion.text = "Version : ${buildMeta.versionName}\n" +
"Branch: ${buildMeta.gitBranchName}\n" +
"Build: ${buildMeta.buildNumber}"
"Branch: ${buildMeta.gitBranchName}"
views.loginSplashVersion.debouncedClicks { navigator.openDebug(requireContext()) }
}
}

View File

@ -94,7 +94,7 @@ class FtueAuthSplashCarouselFragment :
if (buildMeta.isDebug || vectorPreferences.developerMode()) {
views.loginSplashVersion.isVisible = true
@SuppressLint("SetTextI18n")
views.loginSplashVersion.text = "Version : ${buildMeta.versionName}#${buildMeta.buildNumber}\n" +
views.loginSplashVersion.text = "Version : ${buildMeta.versionName}\n" +
"Branch: ${buildMeta.gitBranchName}"
views.loginSplashVersion.debouncedClicks { navigator.openDebug(requireContext()) }
}

View File

@ -67,8 +67,7 @@ class FtueAuthSplashFragment :
views.loginSplashVersion.isVisible = true
@SuppressLint("SetTextI18n")
views.loginSplashVersion.text = "Version : ${buildMeta.versionName}\n" +
"Branch: ${buildMeta.gitBranchName}\n" +
"Build: ${buildMeta.buildNumber}"
"Branch: ${buildMeta.gitBranchName}"
views.loginSplashVersion.debouncedClicks { navigator.openDebug(requireContext()) }
}
}

View File

@ -283,7 +283,7 @@ class BugReporter @Inject constructor(
.addFormDataPart("user_id", userId)
.addFormDataPart("can_contact", canContact.toString())
.addFormDataPart("device_id", deviceId)
.addFormDataPart("version", versionProvider.getVersion(longFormat = true, useBuildNumber = false))
.addFormDataPart("version", versionProvider.getVersion(longFormat = true))
.addFormDataPart("branch_name", buildMeta.gitBranchName)
.addFormDataPart("matrix_sdk_version", Matrix.getSdkVersion())
.addFormDataPart("olm_version", olmVersion)
@ -305,11 +305,6 @@ class BugReporter @Inject constructor(
}
}
val buildNumber = buildMeta.buildNumber
if (buildNumber.isNotEmpty() && buildNumber != "0") {
builder.addFormDataPart("build_number", buildNumber)
}
// add the gzipped files
for (file in gzippedFiles) {
builder.addFormDataPart("compressed-log", file.name, file.asRequestBody(MimeTypes.OctetStream.toMediaTypeOrNull()))

View File

@ -70,7 +70,7 @@ class VectorUncaughtExceptionHandler @Inject constructor(
val appName = "Element" // TODO Matrix.getApplicationName()
b.append(appName + " Build : " + versionCodeProvider.getVersionCode() + "\n")
b.append("$appName Version : ${versionProvider.getVersion(longFormat = true, useBuildNumber = true)}\n")
b.append("$appName Version : ${versionProvider.getVersion(longFormat = true)}\n")
b.append("SDK Version : ${Matrix.getSdkVersion()}\n")
b.append("Phone : " + Build.MODEL.trim() + " (" + Build.VERSION.INCREMENTAL + " " + Build.VERSION.RELEASE + " " + Build.VERSION.CODENAME + ")\n")

View File

@ -69,7 +69,7 @@ class VectorSettingsHelpAboutFragment :
// application version
findPreference<VectorPreference>(VectorPreferences.SETTINGS_VERSION_PREFERENCE_KEY)!!.let {
it.summary = buildString {
append(versionProvider.getVersion(longFormat = false, useBuildNumber = true))
append(versionProvider.getVersion(longFormat = false))
if (buildMeta.isDebug) {
append(" ")
append(buildMeta.gitBranchName)

View File

@ -25,7 +25,7 @@ class VersionProvider @Inject constructor(
private val buildMeta: BuildMeta,
) {
fun getVersion(longFormat: Boolean, useBuildNumber: Boolean): String {
fun getVersion(longFormat: Boolean): String {
var result = "${buildMeta.versionName} [${versionCodeProvider.getVersionCode()}]"
var flavor = buildMeta.flavorShortDescription
@ -34,19 +34,10 @@ class VersionProvider @Inject constructor(
flavor += "-"
}
var gitVersion = buildMeta.gitRevision
val gitVersion = buildMeta.gitRevision
val gitRevisionDate = buildMeta.gitRevisionDate
val buildNumber = buildMeta.buildNumber
var useLongFormat = longFormat
if (useBuildNumber && buildNumber != "0") {
// It's a build from CI
gitVersion = "b$buildNumber"
useLongFormat = false
}
result += if (useLongFormat) {
result += if (longFormat) {
" ($flavor$gitVersion-$gitRevisionDate)"
} else {
" ($flavor$gitVersion)"