-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
213 lines (200 loc) · 6.97 KB
/
Copy path.goreleaser.yaml
File metadata and controls
213 lines (200 loc) · 6.97 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# GoReleaser config. Builds cross-platform binaries on a pushed tag (v*),
# publishes a GitHub Release, and updates the Homebrew tap formula and the
# NUR package.
# Docs: https://goreleaser.com
version: 2
before:
hooks:
- go mod tidy
builds:
- id: md2
main: .
binary: md2
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}}
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
archives:
- id: md2
formats: [tar.gz]
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
format_overrides:
- goos: windows
formats: [zip]
# Native Linux packages built from the compiled linux binaries and attached to
# the GitHub Release. nfpm auto-skips non-linux builds, so this packages just
# linux/amd64 and linux/arm64. No external repo/token needed.
nfpms:
- id: md2
package_name: md2
ids:
- md2
formats:
- deb
- rpm
- apk
# Distro-conventional filenames (e.g. md2_1.2.3_amd64.deb,
# md2-1.2.3.x86_64.rpm, md2_1.2.3_x86_64.apk).
file_name_template: "{{ .ConventionalFileName }}"
maintainer: "Luiz Henrique Rapatao <rapatao@rapatao.com>"
homepage: "https://github.com/rapatao/md2"
description: "Convert markdown files to PDF, HTML, and text"
license: MIT
bindir: /usr/bin
# Container images. Both variants are built per-arch from the already-compiled
# binaries (no in-image compile), then combined into multi-arch manifests.
# :latest / :<version> full — Debian + Chromium, every feature works
# :slim / :<version>-slim slim — distroless, no browser features
# Published to GHCR. arm64 images build under QEMU emulation on the amd64 runner.
dockers:
- id: md2-full-amd64
goos: linux
goarch: amd64
dockerfile: Dockerfile
use: buildx
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Convert markdown files to PDF, HTML, and text"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.source=https://github.com/rapatao/md2"
- "--label=org.opencontainers.image.licenses=MIT"
- id: md2-full-arm64
goos: linux
goarch: arm64
dockerfile: Dockerfile
use: buildx
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Convert markdown files to PDF, HTML, and text"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.source=https://github.com/rapatao/md2"
- "--label=org.opencontainers.image.licenses=MIT"
- id: md2-slim-amd64
goos: linux
goarch: amd64
dockerfile: Dockerfile.slim
use: buildx
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Convert markdown files to PDF, HTML, and text (slim, no browser features)"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.source=https://github.com/rapatao/md2"
- "--label=org.opencontainers.image.licenses=MIT"
- id: md2-slim-arm64
goos: linux
goarch: arm64
dockerfile: Dockerfile.slim
use: buildx
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Convert markdown files to PDF, HTML, and text (slim, no browser features)"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.source=https://github.com/rapatao/md2"
- "--label=org.opencontainers.image.licenses=MIT"
docker_manifests:
- name_template: "ghcr.io/rapatao/md2:{{ .Version }}"
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-amd64"
- "ghcr.io/rapatao/md2:{{ .Version }}-arm64"
# Empty name_template on a prerelease → goreleaser skips the manifest, so the
# floating :latest tag never moves to a prerelease.
- name_template: "{{ if not .Prerelease }}ghcr.io/rapatao/md2:latest{{ end }}"
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-amd64"
- "ghcr.io/rapatao/md2:{{ .Version }}-arm64"
- name_template: "ghcr.io/rapatao/md2:{{ .Version }}-slim"
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-amd64"
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-arm64"
- name_template: "{{ if not .Prerelease }}ghcr.io/rapatao/md2:slim{{ end }}"
image_templates:
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-amd64"
- "ghcr.io/rapatao/md2:{{ .Version }}-slim-arm64"
# Keyless cosign signatures over the pushed multi-arch manifests, mirroring the
# checksum signing below.
docker_signs:
- cmd: cosign
artifacts: manifests
args:
- sign
- "--yes"
- "${artifact}@${digest}"
checksum:
name_template: "checksums.txt"
signs:
- cmd: cosign
signature: "${artifact}.sig"
certificate: "${artifact}.pem"
args:
- sign-blob
- "--yes"
- "--output-signature=${signature}"
- "--output-certificate=${certificate}"
- "${artifact}"
artifacts: checksum
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
homebrew_casks:
- name: md2
repository:
owner: rapatao
name: homebrew-tap
token: "{{ .Env.GH_RELEASE_TOKEN }}"
homepage: "https://github.com/rapatao/md2"
description: "Convert markdown files to PDF, HTML, and text"
# Strip the macOS quarantine flag so the unsigned binary runs without
# a Gatekeeper prompt.
hooks:
post:
install: |
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/md2"]
end
nix:
- name: md2
ids:
- md2
repository:
owner: rapatao
name: nur-packages
token: "{{ .Env.GH_RELEASE_TOKEN }}"
path: pkgs/md2/default.nix
homepage: "https://github.com/rapatao/md2"
description: "Convert markdown files to PDF, HTML, and text"
license: "mit"
main_program: md2
release:
github:
owner: rapatao
name: md2
draft: false
prerelease: auto