-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
138 lines (132 loc) · 4.28 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
127
128
129
130
131
132
133
134
135
136
137
138
# =============================================================================
# Configuration for `goreleaser`.
# =============================================================================
# What It Is
#
# This is a configuration file to release the built app. Both to releases page
# and to Homebrew's tap repository.
#
# The `goreleaser` command will read this configuration to "automate" releasing
# the built binaries via GitHub action on release push. It automates Homebrew's
# tap release as well.
#
# What It Does
#
# This file was generated via `goreleaser init` then customized. It will:
#
# 1. Build the binaries for various OS and architectures.
# - Linux, macOS and Windows.
# - AMD (Intel/x86_64) and ARM64 for all OS and ARM32 v5,6,7 for Linux.
# 2. Archives the built binaries and create checksum.txt file.
# 3. Create a tap config file for Homebrew. (./bin/<app_name>.rb)
# 4. It pushes the archived assets to the release page on GitHub.
# 5. It pushes the config file for Homebrew tap installation to the repo.
# https://github.com/Qiitadon/homebrew-apps/
#
# How It Works
#
# This file will be called from ./github/workflows/release_bin.yaml action if
# the push was a release. After generating the additional assets, it releases/
# pushes the archived assets to the release-page. Then commit/push the Homebrew
# configuration file to the Homebrew tap repo of this app.
#
# For local-test run:
# $ goreleaser release --snapshot --skip-publish --rm-dist
# $ # *Note: Check the ./bin/ dir after ran.
#
# Make sure to check the documentation as well at:
# https://goreleaser.com/customization/
# =============================================================================
before:
hooks:
- go mod download
# Name to use on test release with --snapshot option.
snapshot:
name_template: '{{ .Version }}'
# Directory name to distribute
dist: bin
# Settings to build the binaries.
builds:
-
# Target directory of main.go (Don't forget to change tha path to main.go)
main: ./cmd
# Output binary name
binary: qiitan
env:
- CGO_ENABLED=0
# Target OS
goos:
- linux
- windows
- darwin
# Target architectures
goarch:
- amd64
- arm
- arm64
# Variant for ARM32
goarm:
- "5"
- "6"
- "7"
# Ignore ARM32/ARM64 build for both macOS and Windows
ignore:
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
# Build the app as static binary and embed version and commit info
ldflags:
- -s -w -extldflags '-static' -X 'main.version={{.Version}}' -X 'main.commit={{ .ShortCommit }}'
# macOS universal binaries for both arm64 and amd64
universal_binaries:
-
name_template: 'qiitan'
# Combine arm64 and amd64 as a single binary and remove each
replace: true
# Archiving the built binaries
archives:
-
replacements:
darwin: macOS
linux: Linux
windows: Windows
amd64: x86_64
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
# Create checksum file of archived files
checksum:
name_template: 'checksums.txt'
# Release/update Homebrew tap repository
brews:
-
# Name of the Homebrew package: /<TAP REPO ROOT DIR>/Formula/<name>.rb
name: qiitan
# Target repo to tap: Qiitadon/homebrew-apps
tap:
owner: Qiitadon
name: homebrew-apps
# Target directory: Qiitadon/homebrew-apps/Formula
folder: Formula
# URL of the archive in releases page
url_template: "https://github.com/Qiitadon/Qiitan-go/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# Author info to commit to the tap repo
commit_author:
name: goreleaserbot
email: [email protected]
# Message to display on `brew search` or `brew info`
description: "This is a sample app of github.com/Qiitadon/Qiitan-go. It simply prints 'Hello, Gopher!'."
homepage: "https://github.com/Qiitadon/Qiitan-go/"
# Let brew command pull the archive via cURL
download_strategy: CurlDownloadStrategy
# Let brew command instll the binary as `qiitan`
install: |
bin.install "qiitan"
# Smoke test to run after install
test: |
system "#{bin}/qiitan --version"