Skip to content

Commit

Permalink
Fix turfVersion type and script to set version for SPM test
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksproger committed Nov 13, 2024
1 parent 5b95a8e commit f07ebd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
let commonVersion = "24.9.0-daily-2024-11-13-04-26"
let commonChecksum = "16deedc1d8a3bb5b0bebd3e7eb222c87056f04cd9448af21059eed4228c44153"

let turfVersion = "4.0.0-beta.1"
let turfVersion: Version = "4.0.0-beta.1"

let package = Package(
name: "MapboxCommon",
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/SPM/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options:
packages:
MapboxCommon:
url: [email protected]:mapbox/mapbox-common-ios.git
branch: release-v24.0.0-rc.2
branch: v24.9.0-daily-2024-11-12-04-00
targets:
SPMTest:
type: application
Expand Down
12 changes: 10 additions & 2 deletions scripts/release/Sources/set-marketing-version/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ struct MarketingVersion: ParsableCommand {
try content.write(toFile: url.path, atomically: true, encoding: .utf8)
}

func runCarthageVersionUpdate() throws {
let cartfileURL = projectPathURL.appendingPathComponent("Tests/Integration/Carthage/Cartfile")
try replaceLineContaining("binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common/",
with: "binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json\" == \(marketingVersion)",
in: cartfileURL)
}

func runCocoaPodsVersionUpdate() throws {
let podfileURL = projectPathURL.appendingPathComponent("Tests/Integration/CocoaPods/Podfile")
try replaceLineContaining("pod 'MapboxCommon'",
Expand All @@ -54,8 +61,8 @@ struct MarketingVersion: ParsableCommand {

func runSPMVersionUpdate() throws {
let spmManifestURL = projectPathURL.appendingPathComponent("Tests/Integration/SPM/project.yml")
try replaceLineContaining("branch: release/v",
with: " branch: release/v\(marketingVersion)",
try replaceLineContaining("branch: v",
with: " branch: v\(marketingVersion)",
in: spmManifestURL)
let spmPackageURL = projectPathURL.appendingPathComponent("Package.swift")
try replaceLineContaining("let version =",
Expand All @@ -78,6 +85,7 @@ struct MarketingVersion: ParsableCommand {
mutating func run() throws {
try runCocoaPodsVersionUpdate()
try runSPMVersionUpdate()
try runCarthageVersionUpdate()

if isPreRelease {
print("Not updating README.md because this is a proper release.")
Expand Down

0 comments on commit f07ebd3

Please sign in to comment.