Skip to content

Commit

Permalink
fix(build): binary asset names and build vars (#78)
Browse files Browse the repository at this point in the history
* build(go): remove name_template

* fix(build): buildinfo vars
  • Loading branch information
zze0s committed Feb 29, 2024
1 parent 19f67ea commit 7232115
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ builds:
goarch: arm64
main: ./cmd/omegabrr/main.go
binary: omegabrr
ldflags:
- -s -w -X github.com/autobrr/omegabrr/internal/buildinfo.Version=v{{.Version}} -X github.com/autobrr/omegabrr/internal/buildinfo.Commit={{.Commit}} -X github.com/autobrr/omegabrr/internal/buildinfo.Date={{.Date}} -X github.com/autobrr/omegabrr/internal/buildinfo.BuiltBy=goreleaser'

archives:
- id: omegabrr
Expand All @@ -38,12 +40,6 @@ archives:
format_overrides:
- goos: windows
format: zip
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}

release:
prerelease: auto
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY . ./
#ENV GOOS=linux
ENV CGO_ENABLED=0

RUN go build -ldflags "-s -w -X buildinfo.Version=${VERSION} -X buildinfo.Commit=${REVISION} -X buildinfo.Date=${BUILDTIME}" -o bin/omegabrr cmd/omegabrr/main.go
RUN go build -ldflags "-s -w -X github.com/autobrr/omegabrr/internal/buildinfo.Version=${VERSION} -X github.com/autobrr/omegabrr/internal/buildinfo.Commit=${REVISION} -X github.com/autobrr/omegabrr/internal/buildinfo.Date=${BUILDTIME}" -o bin/omegabrr cmd/omegabrr/main.go

# build runner
FROM alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export GOARCH=$TARGETARCH; \
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v6" ]] && export GOARM=6; \
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v7" ]] && export GOARM=7; \
echo $GOARCH $GOOS $GOARM$GOAMD64; \
go build -ldflags "-s -w -X buildinfo.Version=${VERSION} -X buildinfo.Commit=${REVISION} -X buildinfo.Date=${BUILDTIME}" -o /out/bin/omegabrr cmd/omegabrr/main.go
go build -ldflags "-s -w -X github.com/autobrr/omegabrr/internal/buildinfo.Version=${VERSION} -X github.com/autobrr/omegabrr/internal/buildinfo.Commit=${REVISION} -X github.com/autobrr/omegabrr/internal/buildinfo.Date=${BUILDTIME}" -o /out/bin/omegabrr cmd/omegabrr/main.go

# build runner
FROM alpine:latest AS runner
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GIT_TAG := $(shell git tag --points-at HEAD 2> /dev/null | head -n 1)

GO ?= go
RM ?= rm
GOFLAGS ?= "-X buildinfo.Commit=$(GIT_COMMIT) -X buildinfo.Version=$(GIT_TAG)"
GOFLAGS ?= "-X github.com/autobrr/omegabrr/internal/buildinfo.Commit=$(GIT_COMMIT) -X github.com/autobrr/omegabrr/internal/buildinfo.Version=$(GIT_TAG)"
PREFIX ?= /usr/local
BINDIR ?= bin

Expand Down

0 comments on commit 7232115

Please sign in to comment.