-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.goreleaser.yaml
executable file
·154 lines (133 loc) · 4.67 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
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 1
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
# .goreleaser.yaml
dockers:
# You can have multiple Docker images.
- #
# ID of the image, needed if you want to filter by it later on (e.g. on custom publishers).
id: myimg
# GOOS of the built binaries/packages that should be used.
# Default: 'linux'
goos: linux
# GOARCH of the built binaries/packages that should be used.
# Default: 'amd64'
goarch: amd64
# GOARM of the built binaries/packages that should be used.
# Default: '6'
goarm: ""
# GOAMD64 of the built binaries/packages that should be used.
# Default: 'v1'
goamd64: "v2"
# IDs to filter the binaries/packages.
#
# Make sure to only include the IDs of binaries you want to `COPY` in your
# Dockerfile.
#
# If you include IDs that don't exist or are not available for the current
# architecture being built, the build of the image will be skipped.
ids:
- mybuild
- mynfpm
# Templates of the Docker image names.
#
# Templates: allowed
image_templates:
- "g1ang/gorealeser:latest"
- "g1ang/gorealeser:{{ .Tag }}"
- "g1ang/gorealeser:v{{ .Major }}"
#- "gcr.io/g1ang/gorealeser:latest"
# Skips the docker build.
# Could be useful if you want to skip building the windows docker image on
# linux, for example.
# Skips the docker push.
# Could be useful if you also do draft releases.
#
# If set to auto, the release will not be pushed to the Docker repository
# in case there is an indicator of a prerelease in the tag, e.g. v1.0.0-rc1.
#
# Templates: allowed (since v1.19)
skip_push: false
# Path to the Dockerfile (from the project root).
#
# Default: 'Dockerfile'
# Templates: allowed
dockerfile: old_build/Dockerfile
# Use this instead of `dockerfile` if the contents of your Dockerfile are
# supposed to go through the template engine as well.
#
# `dockerfile` is ignored when this is set.
# Set the "backend" for the Docker pipe.
#
# Valid options are: docker, buildx, podman.
#
# Podman is a GoReleaser Pro feature and is only available on Linux.
#
# Default: 'docker'
use: docker
# Docker build flags.
#
# Templates: allowed
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64"
# Extra flags to be passed down to the push command.
push_flags:
- --tls-verify=false
# If your Dockerfile copies files other than binaries and packages,
# you should list them here as well.
# Note that GoReleaser will create the same structure inside a temporary
# directory, so if you add `foo/bar.json` here, on your Dockerfile you can
# `COPY foo/bar.json /whatever.json`.
# Also note that the paths here are relative to the directory in which
# GoReleaser is being run (usually the repository root directory).
# This field does not support wildcards, you can add an entire directory here
# and use wildcards when you `COPY`/`ADD` in your Dockerfile.
extra_files:
- go.mod
- go.sum
# Additional templated extra files to add to the Docker image.
# Those files will have their contents pass through the template engine,
# and its results will be added to the build context the same way as the
# extra_files field above.
#