Repository navigation
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
71 lines (64 loc) · 2.51 KB
/
Copy path.goreleaser.yaml
File metadata and controls
71 lines (64 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# goreleaser config for yolorouter. Push a `v*` tag to trigger a release
# via .github/workflows/release.yml.
version: 2
project_name: yolorouter
before:
hooks:
# embed-frontend (NOT just `make frontend`) clears web/dist and repopulates
# it from a real frontend build. web/embed_real.go reads web/dist under
# -tags embed, and web/dist is fully gitignored — so a clean CI checkout
# has no web/dist at all until this step runs, and `go build -tags embed`
# would otherwise fail its go:embed or ship a binary with no UI.
- make embed-frontend
builds:
- id: yolorouter
main: ./cmd/yolorouter
binary: yolorouter
tags:
- release
- embed
# goreleaser Go targets use the UNDERSCORE form (linux_amd64), not the
# linux/amd64 form — the slash form is silently rejected and produces no
# archives for that target.
targets:
- linux_amd64
- linux_arm64
- darwin_amd64
- darwin_arm64
- windows_amd64
- windows_arm64
ldflags:
- -s -w
# goreleaser's {{ .Version }} STRIPS the leading "v" from the tag, so
# re-add it: internal/version.Version must be "v0.1.0" (not "0.1.0") to
# match GitHub's tag_name, the archive name below, and
# golang.org/x/mod/semver's mandatory v-prefix. {{ .ShortCommit }} and
# {{ .Date }} are used verbatim. DEFAULT_GITHUB_REPO is injected from a
# repository Variable by the release workflow (empty until the repo is
# public — the update feature then relies on config.update.github_repo).
- -X github.com/yolorouter/yolorouter/internal/version.Version=v{{ .Version }}
- -X github.com/yolorouter/yolorouter/internal/version.Commit={{ .ShortCommit }}
- -X github.com/yolorouter/yolorouter/internal/version.BuildTime={{ .Date }}
- -X github.com/yolorouter/yolorouter/internal/version.DefaultGitHubRepo={{ .Env.DEFAULT_GITHUB_REPO }}
archives:
- formats: [tar.gz]
# Windows users expect a .zip; keep tar.gz for unix targets.
format_overrides:
- goos: windows
formats: [zip]
# Archive name carries the leading v (v0.1.0) to match tag_name, so the
# `update` command's matchAsset — which keys off tag_name — finds the
# right file: yolorouter_v{tag}_{os}_{arch}.tar.gz
name_template: yolorouter_v{{ .Version }}_{{ .Os }}_{{ .Arch }}
checksum:
name_template: checksums.txt
algorithm: sha256
changelog:
use: git
filters:
exclude:
- '^docs:'
- '^test:'
- '^chore:'
release:
disable: false