-
Notifications
You must be signed in to change notification settings - Fork 3
/
.goreleaser.yaml
260 lines (224 loc) · 8.59 KB
/
.goreleaser.yaml
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# The project name is used in the name of the Brew formula, archives, etc.
# If none is given, it will be inferred from the name of the GitHub, GitLab, or Gitea release.
project_name: iacker
before:
hooks:
- go mod tidy
env:
- GO111MODULE=on
- CGO_ENABLED=0
builds:
# You can have multiple builds defined as a yaml list
# - main: ./cmd/cli
# id: "cli"
# binary: cli
# - main: ./cmd/worker
# id: "worker"
# binary: worker
# Path to main.go file or main package.
# Notice: when used with `gomod.proxy`, this must be a package.
# Default is `.`.
- main: ./cmd/iacker
# Binary name.
# Can be a path (e.g. `bin/app`) to wrap the binary in a directory.
# Default is the name of the project directory.
binary: iacker
# GOOS list to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are darwin and linux.
goos:
- linux
- windows
- darwin
# GOARCH to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are 386, amd64 and arm64.
goarch:
- amd64
- arm64
# # GOARM to build for when GOARCH is arm.
# # For more info refer to: https://golang.org/doc/install/source#environment
# # Default is only 6.
# goarm:
# - 6
# - 7
# # GOAMD64 to build when GOARCH is amd64.
# # For more info refer to: https://golang.org/doc/install/source#environment
# # Default is only v1.
# goamd64:
# - v2
# - v3
# your github_token in this file
# or
# setup ENV GitHub token: $ export GITHUB_TOKEN="YOUR_GH_TOKEN"
# github_token: ~/go/src/github.com/github_token
env_files: {}
changelog:
# Set this to true if you don't want any changelog at all.
# Warning: this will also ignore any changelog files passed via `--release-notes`,
# and will render an empty changelog.
# This may result in an empty release notes on GitHub/GitLab/Gitea.
skip: false
# Changelog generation implementation to use.
#
# Valid options are:
# - `git`: uses `git log`;
# - `github`: uses the compare GitHub API, appending the author login to the changelog.
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog.
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
#
# Defaults to `git`.
use: github-native
# Sorts the changelog by the commit's messages.
# Could either be asc, desc or empty
# Default is empty
sort: asc
# Max commit hash length to use in the changelog.
#
# 0: use whatever the changelog implementation gives you
# -1: remove the commit hash from the changelog
# any other number: max length.
#
# Default: 0.
abbrev: 0
# Group commits messages by given regex and title.
# Order value defines the order of the groups.
# Proving no regex means all commits will be grouped under the default group.
# Groups are disabled when using github-native, as it already groups things by itself.
#
# Default is no groups.
filters:
# Commit messages matching the regexp listed here will be removed from
# the changelog
# Default is empty
exclude:
- '^docs:'
- typo
snapshot:
# Allows you to change the name of the generated snapshot
#
# Note that some pipes require this to be semantic version compliant (nfpm,
# for example).
#
# Default is `{{ .Version }}-SNAPSHOT-{{.ShortCommit}}`.
name_template: '{{ incpatch .Version }}-devel'
dockers:
- image_templates: ["ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-amd64"]
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/guancecloud/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/guancecloud/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
- image_templates: ["ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-arm64v8"]
goarch: arm64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/arm64/v8
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/guancecloud/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/guancecloud/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
docker_manifests:
- name_template: ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}
image_templates:
- ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-arm64v8
- name_template: ghcr.io/guancecloud/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/guancecloud/{{ .ProjectName }}:{{ .Version }}-arm64v8
# GoReleaser can be wired to nfpm to generate and publish .deb, .rpm and .apk packages.
nfpms:
- id: guance
maintainer: Guance Cloud <[email protected]>
vendor: Guance Cloud Inc.
description: Command-Line Toolkit for Guance Cloud
homepage: https://guance.io
license: MIT
formats:
- deb
- rpm
- apk
- archlinux
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
# publishers:
# - name: fury.io
# # by specifying `packages` id here goreleaser will only use this publisher
# # with artifacts identified by this id
# ids:
# - guance
# dir: "{{ dir .ArtifactPath }}"
# cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/guancecloud/
# brews:
# -
# # Name template of the recipe
# # Default to project name
# # name: "{{ .ProjectName }}"
# # NOTE: make sure the url_template, the token and given repo (github or
# # gitlab) owner and name are from the same kind.
# # We will probably unify this in the next major version like it is
# # done with scoop.
# # GitHub/GitLab repository to push the formula to
# tap:
# # Repository owner template. (templateable)
# owner: GuanceCloud
# # Repository name. (templateable)
# name: homebrew-tap
# # Optionally a branch can be provided. (templateable)
# #
# # Defaults to the default repository branch.
# branch: main
# # Optionally a token can be provided, if it differs from the token
# # provided to GoReleaser
# token: "{{ .Env.GITHUB_TOKEN }}"
# # Template for the url which is determined by the given Token (github,
# # gitlab or gitea)
# #
# # Default depends on the client.
# url_template: "https://github.com/GuanceCloud/{{ .ProjectName }}/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# # Allows you to set a custom download strategy. Note that you'll need
# # to implement the strategy and add it to your tap repository.
# # Example: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly
# # Default is empty.
# download_strategy: CurlDownloadStrategy
# # Git author used to commit to the repository.
# # Defaults are shown.
# commit_author:
# name: guance-bot
# email: [email protected]
# # The project name and current git tag are used in the format string.
# commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
# # Folder inside the repository to put the formula.
# # Default is the root folder.
# folder: Formula
# # Your app's homepage.
# # Default is empty.
# homepage: "https://guance.io/"
# # Template of your app's description.
# # Default is empty.
# description: "Software to create fast and easy drum rolls."
# # SPDX identifier of your app's license.
# # Default is empty.
# license: "MIT"
# # So you can `brew test` your formula.
# # Default is empty.
# test: |
# system "#{bin}/iacker version"
# # ...
# # Custom install script for brew.
# # Default is 'bin.install "the binary name"'.
# install: |
# bin.install "iacker"
# # ...