From e9133ef82bf4cea631c768139875e8c56bcb427b Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 5 Jun 2025 19:18:46 +0200 Subject: [PATCH] docs: link to Docker image, APT, in release notes --- relnotes/v1.md | 7 +++++++ script/relnotes.go | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/relnotes/v1.md b/relnotes/v1.md index 0345719a0..ec7d8c007 100644 --- a/relnotes/v1.md +++ b/relnotes/v1.md @@ -6,3 +6,10 @@ protocol compatible with Syncthing 1. More detailed information about Syncthing 2 can be found in the release notes at https://github.com/syncthing/syncthing/releases. + +This release is also available as: + +* APT repository: https://apt.syncthing.net/ + +* Docker image: `docker.io/syncthing/syncthing:{{.version}}` or `ghcr.io/syncthing/syncthing:{{.version}}` + (`{docker,ghcr}.io/syncthing/syncthing:1` to follow just the major version) diff --git a/script/relnotes.go b/script/relnotes.go index 3296e6dab..a1b97f844 100644 --- a/script/relnotes.go +++ b/script/relnotes.go @@ -22,6 +22,7 @@ import ( "os" "regexp" "strings" + "text/template" ) var ( @@ -59,12 +60,24 @@ func main() { // Load potential additional release notes from within the repo func additionalNotes(newVer string) ([]string, error) { + data := map[string]string{ + "version": strings.TrimLeft(newVer, "v"), + } + var notes []string ver, _, _ := strings.Cut(newVer, "-") for { file := fmt.Sprintf("relnotes/%s.md", ver) if bs, err := os.ReadFile(file); err == nil { - notes = append(notes, strings.TrimSpace(string(bs))) + tpl, err := template.New("notes").Parse(string(bs)) + if err != nil { + return nil, err + } + buf := new(bytes.Buffer) + if err := tpl.Execute(buf, data); err != nil { + return nil, err + } + notes = append(notes, strings.TrimSpace(buf.String())) } else if !os.IsNotExist(err) { return nil, err }