This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.goreleaser.yml
126 lines (126 loc) · 4.01 KB
/
.goreleaser.yml
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
# main project identifier
project_name: affinityctl
# produced artifacts are stored in this folder
dist: dist
# customize execution
before:
hooks:
- go mod download
- go generate ./...
- docker login ghcr.io -u {{ .Env.GITHUB_USER }} -p {{ .Env.GITHUB_TOKEN }}
# artifacts to produce
# https://goreleaser.com/customization/build/
builds:
# a single project can support/require several build targets
- id: affinityctl
# main binary name
binary: affinityctl
# code entrypoint
main: ./cli/main.go
# CLI flags for the 'go build' command
flags:
-v
ldflags:
- -s -w
- -X github.com/aidtechnology/affinityctl/cli/cmd.coreVersion={{.Version}}
- -X github.com/aidtechnology/affinityctl/cli/cmd.buildCode={{.Commit}}
- -X github.com/aidtechnology/affinityctl/cli/cmd.buildTimestamp={{.CommitDate}}
# set the modified timestamp on the output binary to ensure a
# reproducible build
mod_timestamp: '{{ .CommitTimestamp }}'
# disable CGO since it's not supported
env:
- CGO_ENABLED=0
# supported OSs
goos:
- linux
- windows
- darwin
# supported architectures
goarch:
- amd64
# packages to produce
# https://goreleaser.com/customization/archive/
archives:
# a single project can produce multiple archives
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
# generate integrity checksums
# https://goreleaser.com/customization/checksum/
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256
# Include source code package on the release
# https://goreleaser.com/customization/source/
source:
enabled: true
# produce test releases
# https://goreleaser.com/customization/snapshots/
snapshot:
name_template: "{{ .Version }}-next"
# configure the 'CHANGELOG.md' file produced
# https://goreleaser.com/customization/release/#customize-the-changelog
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- typo
# Produce homebrew formulas for the project artifacts
# https://goreleaser.com/customization/homebrew/
# build and publish docker images
# https://goreleaser.com/customization/docker/
dockers:
-
# GOOS of the built binary that should be used
goos: linux
# GOARCH of the built binary that should be used
goarch: amd64
# Dockerfile location
dockerfile: Dockerfile
# Binaries that should be used
binaries:
- affinityctl
# Build IDs to gather the binaries from
builds:
- affinityctl
# OCI image tags
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.created={{ .CommitDate }}"
# Skips the docker push if there is an indicator for prerelease
# in the tag e.g. v1.0.0-rc1 (auto)
skip_push: auto
image_templates:
- "ghcr.io/aidtechnology/{{ .ProjectName }}:{{ .Version }}"
- "ghcr.io/aidtechnology/{{ .ProjectName }}:latest"
brews:
-
# Formula name
name: affinityctl
# Push the formula to the tap repository
skip_upload: false
# TAP repository
tap:
owner: aidtechnology
name: homebrew-tap
# Use 'github-actions' as commit author
# https://github.community/t/github-actions-bot-email-address/17204
commit_author:
name: github-actions
email: 41898282+github-actions[bot]@users.noreply.github.com
homepage: 'https://github.com/aidtechnology/affinityctl'
description: |
Affinity gateway integration tool.
install: |
bin.install "affinityctl"
output = Utils.popen_read("#{bin}/affinityctl completion bash")
(bash_completion/"affinityctl").write output
output = Utils.popen_read("#{bin}/affinityctl completion zsh")
(zsh_completion/"_affinityctl").write output
prefix.install_metafiles
test: |
system "#{bin}/affinityctl version"