Skip to content

Commit 2f70ee3

Browse files
vgramermjuraga
authored andcommitted
BUILD/MINOR: goreleaser: fix deprecation and release notes generation
also use the format for package name as archive name Signed-off-by: Vincent Gramer <[email protected]>
1 parent 85ba7db commit 2f70ee3

File tree

2 files changed

+92
-9
lines changed

2 files changed

+92
-9
lines changed

.github/workflows/.goreleaser.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v3
12+
with:
13+
# we have to fetch all history to be able to generate the release note. c.f. https://goreleaser.com/ci/actions/.
14+
fetch-depth: 0
1215
- name: Set up Go
1316
uses: actions/setup-go@v2
1417
with:
@@ -18,6 +21,6 @@ jobs:
1821
with:
1922
distribution: goreleaser
2023
version: latest
21-
args: release --rm-dist --skip-announce
24+
args: release --clean --skip-announce
2225
env:
2326
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,20 @@ archives:
3030
id: my-archive
3131
builds:
3232
- my-build
33-
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
34-
replacements:
35-
linux: Linux
36-
darwin: Darwin
37-
freebsd: FreeBSD
38-
386: i386
39-
amd64: x86_64
33+
name_template: >-
34+
{{.ProjectName}}_{{.Version}}_{{.Os }}_
35+
{{- if eq .Arch "amd64" }}x86_64
36+
{{- else if eq .Arch "386" }}i386
37+
{{- else }}{{ .Arch }}{{ end }}
38+
files:
39+
- LICENSE
40+
- README.md
41+
- src: dist/CHANGELOG.md
42+
dst: ""
43+
strip_parent: true
44+
- src: assets/packages/dataplaneapi.yml.dist
45+
dst: ""
46+
strip_parent: true
4047
checksum:
4148
name_template: 'checksums.txt'
4249
snapshot:
@@ -53,3 +60,76 @@ release:
5360
Build date: {{.Date}}
5461
draft: true
5562
name_template: "HAProxy Data Plane API v{{.Version}}"
63+
nfpms:
64+
-
65+
id: my-package
66+
package_name: dataplaneapi
67+
builds:
68+
- my-build
69+
file_name_template: >-
70+
{{.ProjectName}}_{{.Version}}_{{.Os }}_
71+
{{- if eq .Arch "386" }}i386
72+
{{- else }}{{ .Arch }}{{ end }}
73+
vendor: HAProxy Technologies
74+
homepage: https://github.com/haproxytech/dataplaneapi
75+
maintainer: Marko Juraga <[email protected]>
76+
description: HAProxy Data Plane API - API endpoints for managing HAProxy
77+
license: Apache 2.0
78+
formats:
79+
- apk
80+
- deb
81+
- rpm
82+
dependencies:
83+
- haproxy
84+
bindir: /usr/sbin
85+
section: net
86+
priority: optional
87+
contents:
88+
- dst: /etc/dataplaneapi
89+
type: dir
90+
file_info:
91+
owner: root
92+
group: root
93+
mode: 0750
94+
- dst: /var/lib/dataplaneapi
95+
type: dir
96+
file_info:
97+
owner: root
98+
group: root
99+
mode: 0750
100+
- src: assets/packages/dataplaneapi.yml.dist
101+
dst: /etc/dataplaneapi/dataplaneapi.yml
102+
type: "config|noreplace"
103+
file_info:
104+
owner: root
105+
group: root
106+
mode: 0640
107+
- src: assets/packages/dataplaneapi.service
108+
dst: /etc/systemd/system/dataplaneapi.service
109+
type: config
110+
file_info:
111+
owner: root
112+
group: root
113+
mode: 0640
114+
- src: assets/packages/default
115+
dst: /etc/default/dataplaneapi
116+
type: config
117+
file_info:
118+
owner: root
119+
group: root
120+
mode: 0640
121+
- src: assets/packages/logrotate
122+
dst: /etc/logrotate.d/dataplaneapi
123+
type: config
124+
file_info:
125+
owner: root
126+
group: root
127+
mode: 0640
128+
scripts:
129+
postinstall: "assets/packages/post-install.sh"
130+
preremove: "assets/packages/pre-uninstall.sh"
131+
postremove: "assets/packages/post-uninstall.sh"
132+
deb:
133+
lintian_overrides:
134+
- statically-linked-binary
135+
- changelog-file-missing-in-native-package

0 commit comments

Comments
 (0)