Skip to content

Commit

Permalink
update GHA for main branch
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
  • Loading branch information
Issif committed Oct 12, 2023
1 parent b24c374 commit acff415
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions mageFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,33 @@ func BuildLocal() error {
}

// BuildImages build images locally and not push
func BuildImages() error {
func BuildLocaleImages() error {
exportLDFlags()
os.Setenv("KO_DOCKER_REPO", "ko.local/falco-talon")

return sh.RunV("ko", "build", "--bare", "--sbom=none", "--tags", getVersion(), "--tags", getCommit(), "--tags", "latest",
"github.com/Issif/falco-talon")
}

func Build() error {
mg.Deps(Test)
func BuildImages() error {
exportLDFlags()
os.Setenv("KO_DOCKER_REPO", "issif/falco-talon")

return sh.RunV("ko", "build", "--bare", "--sbom=none", "--tags", getVersion(), "--tags", getCommit(), "--tags", "latest",
"github.com/Issif/falco-talon")
}

func PushImages() error {
mg.Deps(BuildImages)
os.Setenv("KO_DOCKER_REPO", "issif/falco-talon")

return sh.RunV("ko", "build", "--bare", "--sbom=none", "--tags", getVersion(), "--tags", getCommit(), "--tags", "latest",
"github.com/Issif/falco-talon")
}

func Build() error {
exportLDFlags()
return sh.RunV("goreleaser", "release", "--clean", "--skip-sign", "--skip-sbom", "--skip-publish")
return sh.RunV("goreleaser", "release", "--clean", "--snapshot", "--skip-sbom", "--skip-publish")
}

func Release() error {
Expand Down Expand Up @@ -86,8 +100,10 @@ func getVersion() string {
return version
}

gitBranch, _ := sh.Output("git", "branch", "--show-current")

// repo without any tags in it
return "v0.0.0"
return gitBranch
}

// getCommit gets the hash of the current commit
Expand Down

0 comments on commit acff415

Please sign in to comment.