forked from ikawaha/kagome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
153 lines (142 loc) · 4.5 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# =============================================================================
# GoReleaser v2 configuration file for Kagome
# =============================================================================
# For local testing run:
# goreleaser --skip-publish --clean --snapshot
#
# Note:
# To build multiarch Docker image, you may be required to install Docker buildx
# plugin and QEMU.
version: 2
env:
- GO111MODULE=on
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
binary: kagome
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
- arm
# Variant for ARM32
goarm:
- "5"
- "6"
- "7"
# Ignore ARM32 build for both macOS and Windows
ignore:
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
# macOS universal binaries. It will join the binaries for AMD64 and Amd64 into
# a single binary. Suitable for Apple Silicon (Arm64) and Intel (amd64).
universal_binaries:
-
name_template: 'kagome'
# Remove each after joining
replace: true
brews:
- repository:
owner: ikawaha
name: homebrew-kagome
commit_author:
name: goreleaserbot
email: [email protected]
description: "Self-contained Japanese Morphological Analyzer written in pure Go."
homepage: "https://github.com/ikawaha/kagome"
directory: Formula
install: |
bin.install "kagome"
test: |
system "#{bin}/kagome version"
# Build Docker images. It will copy the built binary from the "builds" step above.
dockers:
- image_templates:
- "ikawaha/kagome:{{ .Version }}-amd64"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm64"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm64"
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v5"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5"
use: buildx
goarch: arm
goarm: 5
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm/v5"
- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v6"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6"
use: buildx
goarch: arm
goarm: 6
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm/v6"
- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v7"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7"
use: buildx
goarch: arm
goarm: 7
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm/v7"
# Create multiarch manifest file of Docker image. This will bind all the images
# above into a single manifest file for "latest" and each version tag.
docker_manifests:
# Manifest for Docker Hub
- name_template: ikawaha/kagome:{{ .Version }}
image_templates:
- ikawaha/kagome:{{ .Version }}-amd64
- ikawaha/kagome:{{ .Version }}-arm64
- ikawaha/kagome:{{ .Version }}-arm32v5
- ikawaha/kagome:{{ .Version }}-arm32v6
- ikawaha/kagome:{{ .Version }}-arm32v7
- name_template: ikawaha/kagome:latest
image_templates:
- ikawaha/kagome:{{ .Version }}-amd64
- ikawaha/kagome:{{ .Version }}-arm64
- ikawaha/kagome:{{ .Version }}-arm32v5
- ikawaha/kagome:{{ .Version }}-arm32v6
- ikawaha/kagome:{{ .Version }}-arm32v7
# Manifest for GitHub Container Registry
- name_template: ghcr.io/ikawaha/kagome:{{ .Version }}
image_templates:
- ghcr.io/ikawaha/kagome:{{ .Version }}-amd64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7
- name_template: ghcr.io/ikawaha/kagome:latest
image_templates:
- ghcr.io/ikawaha/kagome:{{ .Version }}-amd64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7