fix(build): prepare xgo once during release

Otherwise each release step will pull the image, which makes for a lot of duplication
This commit is contained in:
kolaente
2025-05-13 16:36:37 +02:00
parent f3729eb932
commit e70a3c33ba

View File

@@ -668,7 +668,7 @@ type Release mg.Namespace
// Runs all steps in the right order to create release packages for various platforms
func (Release) Release(ctx context.Context) error {
mg.Deps(initVars)
mg.Deps(Release.Dirs)
mg.Deps(Release.Dirs, prepareXgo)
// Run compiling in parallel to speed it up
errs, _ := errgroup.WithContext(ctx)
@@ -708,6 +708,14 @@ func (Release) Dirs() error {
return nil
}
func prepareXgo() {
mg.Deps(initVars)
checkAndInstallGoTool("xgo", "src.techknowlogick.com/xgo")
fmt.Println("Pulling latest xgo docker image...")
runAndStreamOutput("docker", "pull", "ghcr.io/techknowlogick/xgo:latest")
}
func runXgo(targets string) error {
mg.Deps(initVars)
checkAndInstallGoTool("xgo", "src.techknowlogick.com/xgo")