Skip to content

Commit 30aa8ec

Browse files
authored
Automatically update SPM version variable (#7593)
1 parent 72ef855 commit 30aa8ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct InitializeRelease {
2525
let branch = createReleaseBranch(path: gitRoot, version: manifest.version)
2626
updatePodspecs(path: gitRoot, manifest: manifest)
2727
updatePodfiles(path: gitRoot, version: manifest.version)
28+
updateSwiftPackageVersion(path: gitRoot, version: manifest.version)
2829
return branch
2930
}
3031

@@ -128,4 +129,10 @@ struct InitializeRelease {
128129
"'Firebase',[[:space:]]*'\\).*'#\\1\(version)'#\" Podfile"
129130
Shell.executeCommand(sedCommand2, workingDir: collisionPodfile)
130131
}
132+
133+
private static func updateSwiftPackageVersion(path: URL, version: String) {
134+
// Match strings like `let firebaseVersion = "7.7.0"` and update the version.
135+
Shell.executeCommand("sed -i.bak -e \"s/\\(let firebaseVersion.*=[[:space:]]*\\).*/\\1" +
136+
"\\\"\(version)\\\"/\" Package.swift", workingDir: path)
137+
}
131138
}

0 commit comments

Comments
 (0)