Skip to content

Commit a6d8918

Browse files
beetlebugorgclaude
andcommitted
ci(release): ship both plain and self-contained (_s101) binaries
Mirror `make xbuild`: two GoReleaser builds per platform — a plain binary (no catalogue, needs --s101 at runtime) and an _s101 binary (-tags embed_s101, self-contained). Two archive sets, the embedded one suffixed _s101. Verified via snapshot dry-run: plain reports "embedded: false", _s101 "embedded: true". Only the _s101 variant redistributes the IHO catalogue; README + notices updated to describe both. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 8bfe89e commit a6d8918

3 files changed

Lines changed: 44 additions & 35 deletions

File tree

.goreleaser.yaml

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,50 @@ before:
88
hooks:
99
- go mod tidy
1010

11+
# Two builds per platform, mirroring `make xbuild`:
12+
# - plain: needs `--s101 <dir>` at runtime (no IHO content embedded)
13+
# - _s101: self-contained, embeds the S-101 Portrayal + Feature Catalogues
14+
# (the release workflow runs `make sync-s101` first to populate the embed dir).
15+
# That catalogue is IHO material with no declared license — see
16+
# THIRD-PARTY-NOTICES.md.
17+
# Shared settings live in an anchor so the two only differ by the embed tag.
1118
builds:
1219
- id: chartplotter
1320
main: ./cmd/chartplotter
1421
binary: chartplotter
15-
env:
16-
- CGO_ENABLED=0
17-
# Self-contained: embed the S-101 Portrayal + Feature Catalogues (the release
18-
# workflow syncs them into internal/engine/s101catalog/catalog/ first). That
19-
# catalogue is IHO material with no declared license — see THIRD-PARTY-NOTICES.md.
20-
tags:
21-
- embed_s101
22-
flags:
23-
- -trimpath
24-
ldflags:
25-
- -s -w -X main.version={{ .Version }}
26-
goos:
27-
- linux
28-
- darwin
29-
- windows
30-
goarch:
31-
- amd64
32-
- arm64
22+
env: [CGO_ENABLED=0]
23+
flags: [-trimpath]
24+
ldflags: ["-s -w -X main.version={{ .Version }}"]
25+
goos: [linux, darwin, windows]
26+
goarch: [amd64, arm64]
3327
# No 32-bit / niche targets: the tile baker is memory-hungry.
28+
- id: chartplotter-s101
29+
main: ./cmd/chartplotter
30+
binary: chartplotter
31+
env: [CGO_ENABLED=0]
32+
tags: [embed_s101]
33+
flags: [-trimpath]
34+
ldflags: ["-s -w -X main.version={{ .Version }}"]
35+
goos: [linux, darwin, windows]
36+
goarch: [amd64, arm64]
3437

3538
archives:
3639
- id: chartplotter
40+
ids: [chartplotter]
41+
formats: [tar.gz]
42+
format_overrides:
43+
- goos: windows
44+
formats: [zip]
45+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
46+
files: [README.md, LICENSE, THIRD-PARTY-NOTICES.md]
47+
- id: chartplotter-s101
48+
ids: [chartplotter-s101]
3749
formats: [tar.gz]
38-
# Windows gets a .zip instead of a tarball.
3950
format_overrides:
4051
- goos: windows
4152
formats: [zip]
42-
name_template: >-
43-
{{ .ProjectName }}_
44-
{{- .Version }}_
45-
{{- .Os }}_
46-
{{- .Arch }}
47-
files:
48-
- README.md
49-
- LICENSE
50-
- THIRD-PARTY-NOTICES.md
53+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}_s101"
54+
files: [README.md, LICENSE, THIRD-PARTY-NOTICES.md]
5155

5256
checksum:
5357
name_template: "checksums.txt"

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,13 @@ static binary** for any platform with `GOOS`/`GOARCH` and nothing else to instal
7878

7979
Download an archive for your platform from the
8080
[**Releases**](https://github.com/beetlebugorg/chartplotter/releases) page, extract it,
81-
and put `chartplotter` on your `PATH`. Release binaries are self-contained — they
82-
embed the S-101 catalogue and run with no extra files. (That catalogue is IHO
83-
material; see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).)
81+
and put `chartplotter` on your `PATH`. Each platform ships two builds:
82+
83+
- **`…_s101`** — self-contained: embeds the S-101 catalogue, runs with no extra
84+
files. (That catalogue is IHO material; see
85+
[THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).)
86+
- **plain** — needs `--s101 <PortrayalCatalog dir>` at runtime, pointing at your
87+
own copy of the catalogue.
8488

8589
### With go install
8690

THIRD-PARTY-NOTICES.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ How chartplotter handles them:
8989
(`internal/engine/s101catalog/catalog/`) and synced from an external copy at
9090
build time (`make sync-s101`), so the repository itself does not redistribute
9191
IHO material.
92-
- **Embedded in release binaries.** The release workflow clones the two IHO repos
93-
above and builds with `-tags embed_s101`, so the published binaries are
94-
self-contained and **do** redistribute the catalogue. A plain `go build`
95-
(without the tag) omits it and requires `--s101 <dir>` at runtime.
92+
- **Embedded only in the `_s101` release binaries.** Each release ships two builds
93+
per platform: a plain binary (no catalogue; needs `--s101 <dir>` at runtime) and
94+
an `_s101` binary built with `-tags embed_s101`. The release workflow clones the
95+
two IHO repos above so the `_s101` build embeds the catalogue — only that variant
96+
**redistributes** IHO material.
9697

9798
Because the IHO repositories declare no license, the right to redistribute this
9899
material in release binaries is **unconfirmed**. The IHO copyright and

0 commit comments

Comments
 (0)