func GitHubReleaseDryRun() error {
	tag, err := getLastGitTag()
	if err != nil {
		return err
	}
	fmt.Printf("Git tag: %s\n", tag)
	_, ok := os.LookupEnv("GITHUB_TOKEN")
	if !ok {
		fmt.Println("env variable GITHUB_TOKEN is not set\n")
	}
	if err := sh.RunV("goreleaser", "release", "--rm-dist", "--snapshot", "--skip-publish"); err != nil {
		return err
	}
	return nil
}
GitHubReleaseDryRun goreleaser dry run
package main
import (
	"fmt"
	"os"
	"github.com/magefile/mage/sh"
)
var BinaryName = "dns"
var DockerRegistry = "mxssl"
func Build() error {
	if err := sh.Run("go", "build", "-v", "-mod=vendor", "-o", BinaryName); err != nil {
		return err
	}
	fmt.Printf("%s is successfully built\n", BinaryName)
	return nil
}
func Lint() error {
	if err := sh.Run("golangci-lint", "run", "-v"); err != nil {
		return err
	}
	return nil
}
func Clean() error {
	if !fileExists(BinaryName) {
		return fmt.Errorf("cannnot delete binary: %s doesn't exist", BinaryName)
	}
	if err := sh.Run("rm", "-f", BinaryName); err != nil {
		return err
	}
	fmt.Printf("%s is successfully deleted\n", BinaryName)
	return nil
}
func DockerBuild() error {
	containerWithTag := fmt.Sprintf(DockerRegistry + "/" + BinaryName + ":" + "latest")
	fmt.Printf("Image: %s\n", containerWithTag)
	if err := sh.RunV("docker", "build", "--tag", containerWithTag, "."); err != nil {
		return err
	}
	return nil
}
func DockerTestRun() error {
	containerWithTag := fmt.Sprintf(DockerRegistry + "/" + BinaryName + ":" + "latest")
	fmt.Printf("Image: %s\n", containerWithTag)
	if err := sh.RunV("docker", "container", "run", containerWithTag, "dns", "a", "google.com"); err != nil {
		return err
	}
	return nil
}
func DockerRelease() error {
	fmt.Printf("Registry: %s\n", DockerRegistry)
	tag, err := getLastGitTag()
	if err != nil {
		return err
	}
	fmt.Printf("Git tag: %s\n", tag)
	containerWithTag := fmt.Sprintf(DockerRegistry + "/" + BinaryName + ":" + tag)
	if err := sh.RunV("docker", "build", "--tag", containerWithTag, "."); err != nil {
		return err
	}
	if err := sh.RunV("docker", "push", containerWithTag); err != nil {
		return err
	}
	return nil
}