diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b715eb7..3625840 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -20,6 +20,11 @@ builds: - linux - windows - darwin + goarch: + - amd64 + - arm64 + - riscv64 + - "386" ldflags: - -s -w -X "github.com/Shackelford-Arden/hctx/build.Version={{.Version}}" -X "github.com/Shackelford-Arden/hctx/build.Commit={{.Commit}}" -X "github.com/Shackelford-Arden/hctx/build.Date={{.Date}}" -X "github.com/Shackelford-Arden/hctx/build.BuiltWith=goreleaser" @@ -29,8 +34,10 @@ archives: name_template: >- {{ .ProjectName }}_ {{- title .Os }}_ - {{ .Arch }} - # use zip for windows archives + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} format_overrides: - goos: windows format: zip diff --git a/Taskfile.yml b/Taskfile.yml index d9fbcaf..398ca50 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -23,6 +23,20 @@ tasks: - task: check - task: test + build-test: + cmds: + - cmd: goreleaser release --snapshot --clean + build-dev: cmds: - - cmd: go build -ldflags "-X github.com/Shackelford-Arden/hctx/build.Version=0.0.1 -X github.com/Shackelford-Arden/hctx/build.Commit=dev -X github.com/Shackelford-Arden/hctx/build.Date=now -X github.com/Shackelford-Arden/hctx/build.BuiltWith=go" \ No newline at end of file + - cmd: go build -ldflags "-X github.com/Shackelford-Arden/hctx/build.Version=0.0.1 -X github.com/Shackelford-Arden/hctx/build.Commit=dev -X github.com/Shackelford-Arden/hctx/build.Date=now -X github.com/Shackelford-Arden/hctx/build.BuiltWith=go" + + tag-it: + vars: + LATEST_RELEASE: + sh: changie batch auto && changie merge && changie latest + cmds: + - cmd: git tag -a "{{.LATEST_RELEASE}}" -m "{{.LATEST_RELEASE}}" + - cmd: git push --tags + - cmd: git add CHANGELOG.md + - cmd: git push \ No newline at end of file diff --git a/internal/github/models.go b/internal/github/models.go index b746d8d..78f9c35 100644 --- a/internal/github/models.go +++ b/internal/github/models.go @@ -67,6 +67,13 @@ func releaseName() string { osName = strings.ToUpper(osName[:1]) + osName[1:] osArch := runtime.GOARCH + if osArch == "amd64" { + osArch = "x86_64" + } + + if osArch == "386" { + osArch = "i386" + } return fmt.Sprintf("hctx_%s_%s.tar.gz", osName, osArch)