mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Introduce a build setting to detect Nightly builds. (#5852)
* Allow the AppIconBanner tool to be called with purely the build number. And use that for the Element Pro Nightly. * Use a build setting to determine Nightly builds.
This commit is contained in:
@@ -7,8 +7,8 @@ struct AppIconBanner: AsyncParsableCommand {
|
||||
@Argument(help: "Path to the input image.")
|
||||
var path: String
|
||||
|
||||
@Option(help: "Text for the banner.")
|
||||
var bannerText: String
|
||||
@Option(help: "The build number appended to the app's version.")
|
||||
var buildNumber: Int
|
||||
|
||||
@MainActor
|
||||
func run() async throws {
|
||||
@@ -19,6 +19,9 @@ struct AppIconBanner: AsyncParsableCommand {
|
||||
throw ValidationError("Could not load the image at \(pathURL).")
|
||||
}
|
||||
|
||||
let version = try CI.readMarketingVersion()
|
||||
let bannerText = "\(version) (\(buildNumber))"
|
||||
|
||||
let renderer = ImageRenderer(content: BannerImage(image: image,
|
||||
text: bannerText))
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ struct ConfigureNightly: AsyncParsableCommand {
|
||||
try await CI.run(.name("swift"), ["run", "pipeline", "update-foss-secrets"])
|
||||
try await CI.run(.name("xcodegen"))
|
||||
|
||||
let releaseVersion = try CI.readMarketingVersion()
|
||||
try await generateAppIconBanner(version: releaseVersion, buildNumber: buildNumber)
|
||||
try await generateAppIconBanner(buildNumber: buildNumber)
|
||||
}
|
||||
|
||||
/// Adds the Nightly variant include path to `project.yml` if it isn't already present.
|
||||
@@ -41,9 +40,8 @@ struct ConfigureNightly: AsyncParsableCommand {
|
||||
}
|
||||
|
||||
/// Generates the app icon banner with version and build number.
|
||||
private func generateAppIconBanner(version: String, buildNumber: String) async throws {
|
||||
let bannerText = "\(version) (\(buildNumber))"
|
||||
private func generateAppIconBanner(buildNumber: String) async throws {
|
||||
let iconPath = "Variants/Nightly/Resources/NightlyAppIcon.icon/Assets/Version.png"
|
||||
try await AppIconBanner.parse([iconPath, "--banner-text", bannerText]).run()
|
||||
try await AppIconBanner.parse([iconPath, "--build-number", buildNumber]).run()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user