Skip to content

Commit

Permalink
self update fixes along with packaging adjustments;
Browse files Browse the repository at this point in the history
  • Loading branch information
Shackelford-Arden committed Nov 9, 2024
1 parent d2a194d commit 44641ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand Down
16 changes: 15 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
- 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
7 changes: 7 additions & 0 deletions internal/github/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 44641ce

Please sign in to comment.