mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-29 01:44:39 +02:00
8306b946d3
* feat: allow to use ModulePath on templates Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * feat: initial proxy build support Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: build Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: main check Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: make it more flexible Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: small improvements Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: copy go.sum Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: root mod proxy Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: test Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: snapshots Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: lint Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: proxy main pkg Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: environment variables Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * test: added some tests to go mod proxy feature Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: improve test Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: linte Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: goreleaser.yml Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: simplify tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * test: test build Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: revert unwanted changes Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: allow to run when no mod.suym Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * docs: example Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: not a go module on go 1.15 Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * docs: improve docs as per comments Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
43 lines
817 B
Go
43 lines
817 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime/debug"
|
|
|
|
"github.com/goreleaser/goreleaser/cmd"
|
|
)
|
|
|
|
// nolint: gochecknoglobals
|
|
var (
|
|
version = "dev"
|
|
commit = ""
|
|
date = ""
|
|
builtBy = ""
|
|
)
|
|
|
|
func main() {
|
|
cmd.Execute(
|
|
buildVersion(version, commit, date, builtBy),
|
|
os.Exit,
|
|
os.Args[1:],
|
|
)
|
|
}
|
|
|
|
func buildVersion(version, commit, date, builtBy string) string {
|
|
result := version
|
|
if commit != "" {
|
|
result = fmt.Sprintf("%s\ncommit: %s", result, commit)
|
|
}
|
|
if date != "" {
|
|
result = fmt.Sprintf("%s\nbuilt at: %s", result, date)
|
|
}
|
|
if builtBy != "" {
|
|
result = fmt.Sprintf("%s\nbuilt by: %s", result, builtBy)
|
|
}
|
|
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" {
|
|
result = fmt.Sprintf("%s\nmodule version: %s, checksum: %s", result, info.Main.Version, info.Main.Sum)
|
|
}
|
|
return result
|
|
}
|