This commit is contained in:
nomadics9 2024-12-19 22:56:29 +03:00
parent f39f18a022
commit 2472c82f36
2 changed files with 6 additions and 6 deletions

Binary file not shown.

12
main.go
View file

@ -10,19 +10,19 @@ import (
) )
func updateVersion(repoPath string, serviceName string) error { func updateVersion(repoPath string, serviceName string) error {
versionFile := fmt.Sprintf("%s/version.txt", repoPath) versionPath := fmt.Sprintf("%s/version.txt", repoPath)
versionFile := "version.txt"
newVersion := getVersion(serviceName) newVersion := getVersion(serviceName)
os.WriteFile(versionFile, []byte(newVersion), 0644)
versionPath := "version.txt"
if repoPath == "/data/alaskartv/androidtv-ci" { if repoPath == "/data/alaskartv/androidtv-ci" {
versionPath = "release.txt" versionPath = fmt.Sprintf("%s/release.txt", repoPath)
versionFile = "release.txt"
} }
os.WriteFile(versionPath, []byte(newVersion), 0644)
cmds := [][]string{ cmds := [][]string{
{"git", "-C", repoPath, "add", versionPath}, {"git", "-C", repoPath, "add", versionFile},
{"git", "-C", repoPath, "commit", "-m", fmt.Sprintf("Bump version to %s", newVersion)}, {"git", "-C", repoPath, "commit", "-m", fmt.Sprintf("Bump version to %s", newVersion)},
{"git", "-C", repoPath, "push"}, {"git", "-C", repoPath, "push"},
} }