diff --git a/README.md b/README.md index 6177e1e..323cbb4 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,9 @@ The `sfreleaser` usually simply wraps instructions for other tools, mainly: - [docker](https://docker.com) The `sfreleaser release` usually builds the necessary artifacts, configures `goreleaser`, uploads extra artifacts if necessary and performs the release on GitHub in draft mode. You have then the possibility to review it and publish it. + +### Development Version + +The `sfreleaser` binary uses a build injected value for the `version` which is later used to compare against `sfreleaser-min-version` check in the config file. + +If you build locally, either you the `devel/sfreleaser` script which inject it or `go install -ldflags "-X main.version=0.7.1" ./cmd/sfreleaser` where `0.7.1` should be set to the version you want to "simulate". diff --git a/cmd/sfreleaser/build.go b/cmd/sfreleaser/build.go index 436d245..411199b 100644 --- a/cmd/sfreleaser/build.go +++ b/cmd/sfreleaser/build.go @@ -149,6 +149,8 @@ func build(cmd *cobra.Command, args []string) error { GoreleaserImageID: goreleaserDockerImage, } + fmt.Println() + fmt.Printf("Building artifacts using image %q\n", goreleaserDockerImage) buildArtifacts(global, build, gitHubRelease) return nil diff --git a/cmd/sfreleaser/install.go b/cmd/sfreleaser/install.go index 2575ce1..1e48685 100644 --- a/cmd/sfreleaser/install.go +++ b/cmd/sfreleaser/install.go @@ -16,7 +16,7 @@ import ( var InstallCmd = Command(install, "install", - "Install the necessary files configuration files like .goreleaser", + "Install the necessary files configuration files", Flags(func(flags *pflag.FlagSet) { flags.BoolP("overwrite", "f", false, "[Destructive] Overwrite configuration files that already exists") }), diff --git a/cmd/sfreleaser/main.go b/cmd/sfreleaser/main.go index 3b41b96..a0199b0 100644 --- a/cmd/sfreleaser/main.go +++ b/cmd/sfreleaser/main.go @@ -152,7 +152,7 @@ func onMinVersionCheckFailed(actualVersion string, acceptedMinVersion string) { `), actualVersion, acceptedMinVersion) } -func verifyCommand(command string, onErrorText string) { +func ensureCommandExist(command string, onErrorText string) { zlog.Debug("verifying command", zap.String("command", command)) _, err := exec.LookPath(command) @@ -167,8 +167,8 @@ func verifyCommand(command string, onErrorText string) { } } -func verifyCommandRunSuccesfully(command string, onErrorText string) { - verifyCommand("docker", onErrorText) +func ensureCommandRunSuccesfully(command string, onErrorText string) { + ensureCommandExist("docker", onErrorText) output, _, err := maybeResultOf(command) if err != nil { diff --git a/cmd/sfreleaser/release.go b/cmd/sfreleaser/release.go index 0722738..6c44f51 100644 --- a/cmd/sfreleaser/release.go +++ b/cmd/sfreleaser/release.go @@ -321,7 +321,7 @@ func resolveAsset(asset string, global *GlobalModel, model map[string]any) strin } func verifyTools() { - verifyCommand("docker", cli.Dedent(` + ensureCommandExist("docker", cli.Dedent(` The 'docker' utility (https://docs.docker.com/get-docker/) is perform the release. @@ -330,7 +330,7 @@ func verifyTools() { system. You should also allocate minimally 4 CPU and 8GiB of RAM. `)) - verifyCommandRunSuccesfully("docker info", cli.Dedent(` + ensureCommandRunSuccesfully("docker info", cli.Dedent(` Ensure that your Docker Engine is currently running, it seems it's not running right now because the command 'docker info' failed. @@ -339,7 +339,7 @@ func verifyTools() { execution of the 'docker info' command to get its exit code). `)) - verifyCommand("gh", cli.Dedent(` + ensureCommandExist("gh", cli.Dedent(` The GitHub CLI utility (https://cli.github.com/) is required to obtain information about the current draft release.