-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.goreleaser.ytt
More file actions
240 lines (219 loc) · 6.51 KB
/
.goreleaser.ytt
File metadata and controls
240 lines (219 loc) · 6.51 KB
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
#@ load("@ytt:data", "data")
#@ oses = {
#@ "darwin": ["amd64", "arm64"],
#@ "linux": ["amd64", "arm64"],
#@ }
version: 2
changelog:
sort: asc
use: github
filters:
include:
- '^.*\(#[[:digit:]]+\).*$'
groups:
- title: ⚠️ Breaking Changes
regexp: '^.*?.*?(\(.*?\))?!:.*$'
order: 1
- title: "\U0001F680 New Features"
regexp: '^.*?feat(\(.*?\))?:.*$'
order: 2
- title: "\U0001F41B Bug Fixes"
regexp: '^.*?fix(\(.*?\))?:.*$'
order: 3
- title: "\U0001F4D6 Docs"
regexp: '^.*?docs(\(.*?\))?:.*$'
order: 4
- title: "\U0001F916 Bumps"
regexp: '^.*?(gomod|build)\(deps\):.*$'
order: 5
- title: "\U0001F412 Miscellaneous"
order: 999
release:
github:
owner: unikraft
name: cli
draft: false
prerelease: #@ getattr(data.values, "PRERELEASE", "true") == "true"
mode: replace
#@ if getattr(data.values, "PRERELEASE", "true") == "true":
#@yaml/text-templated-strings
header: |
# Unikraft CLI {{ .Tag }} ({{ .Date }})
> [!WARNING]
>
> This is a **pre-release** version of the Unikraft CLI. It may contain features that are still in development and could be unstable.
## Installation
### 1-liner (macOS & Linux)
```bash
curl --proto '=https' --tlsv1.2 -LsSf https://unikraft.com/cli/install.sh | UNIKRAFT_CLI_INSTALL_CHANNEL=staging sh
```
### Debian/Ubuntu
```bash
# Update and install dependencies
sudo apt update
sudo apt install ca-certificates curl
# Download and add the GPG key
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL \
-o /etc/apt/keyrings/unikraft-cli.gpg \
https://pkg.unikraft.com/debian/cli-apt/keys/cli-apt.gpg
sudo tee /etc/apt/sources.list.d/unikraft-cli.sources <<EOF
Types: deb
URIs: https://pkg.unikraft.com/debian/cli-apt/
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: staging
Signed-By: /etc/apt/keyrings/unikraft-cli.gpg
EOF
# Update and install
sudo apt-get update
sudo apt-get install unikraft-cli=(@= "{}:{}".format(getattr(data.values, "DEB_EPOCH", "1"), getattr(data.values, "DEB_PRERELEASE_VERSION", "")) @)
```
### Fedora/RHEL/Rocky/Alma
```
# Add the Unikraft CLI repository
sudo tee /etc/yum.repos.d/unikraft-cli-rpm.repo <<EOF
[unikraft]
name=unikraft
baseurl=https://pkg.unikraft.com/rpm/cli-rpm/
gpgcheck=0
enabled=1
EOF
# Install the CLI
yum install unikraft-cli-(@= "{}".format(getattr(data.values, "DEB_PRERELEASE_VERSION", "")) @)
```
#@ else:
#@yaml/text-templated-strings
header: |
# Unikraft CLI {{ .Tag }} ({{ .Date }})
> [!NOTE]
>
> This is a **stable** version of the Unikraft CLI.
## Installation
### 1-liner (macOS & Linux)
```bash
curl --proto '=https' --tlsv1.2 -LsSf https://unikraft.com/cli/install.sh | sh
```
### Homebrew (macOS & Linux)
```bash
brew install unikraft/tap/unikraft
```
### Debian/Ubuntu
```bash
# Update and install dependencies
sudo apt update
sudo apt install ca-certificates curl
# Download and add the GPG key
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL \
-o /etc/apt/keyrings/unikraft-cli.gpg \
https://pkg.unikraft.com/debian/cli-apt/keys/cli-apt.gpg
sudo tee /etc/apt/sources.list.d/unikraft-cli.sources <<EOF
Types: deb
URIs: https://pkg.unikraft.com/debian/cli-apt/
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Signed-By: /etc/apt/keyrings/unikraft-cli.gpg
EOF
# Update and install
sudo apt-get update
sudo apt-get install unikraft-cli
```
### Fedora/RHEL/Rocky/Alma
```
# Add the Unikraft CLI repository
sudo tee /etc/yum.repos.d/unikraft-cli-rpm.repo <<EOF
[unikraft]
name=unikraft
baseurl=https://pkg.unikraft.com/rpm/cli-rpm/
gpgcheck=0
enabled=1
EOF
# Install the CLI at the specific pre-release version
yum install unikraft-cli
```
#@ end
before:
hooks:
- sh -c 'rm -rf .goreleaser-docs && mkdir -p .goreleaser-docs/man && go run ./tools/gendocs man --compress .goreleaser-docs/man'
brews:
- name: #@ "unikraft-staging" if getattr(data.values, "PRERELEASE", "true") == "true" else "unikraft"
ids:
#@ for arch in oses["linux"]:
- #@ "archive-unikraft-cli-linux-{}".format(arch)
#@ end
#@ for arch in oses["darwin"]:
- #@ "archive-unikraft-cli-darwin-{}".format(arch)
#@ end
url_template: "https://github.com/unikraft/cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
commit_author:
name: Unikraft Bot
email: monkey@unikraft.io
commit_msg_template: "Bump {{ .ProjectName }} to version {{ .Tag }}"
homepage: "https://unikraft.com"
description: "The official CLI for Unikraft Cloud — deploy and manage unikernels globally in milliseconds."
license: "BSD-3-Clause"
extra_install: |
man1.install Dir["docs/man/*.1.gz"]
skip_upload: false
repository:
owner: unikraft
name: homebrew-tap
builds:
#@ for os, archs in oses.items():
#@ for arch in archs:
- id: #@ "unikraft-{}-{}".format(os, arch)
binary: unikraft
main: ./cmd/unikraft
goos:
- #@ os
goarch:
- #@ arch
flags:
- -buildmode=pie
ldflags:
- -s
- -w
- -extldflags
- -static-pie
- -X unikraft.com/cli/internal/version.Version={{ .Version }}
- -X unikraft.com/cli/internal/version.Commit={{ .Commit }}
- -X unikraft.com/cli/internal/version.BuildTime={{ .Date }}
- -X unikraft.com/cli/internal/telemetry.PostHogAPIKey={{ .Env.UNIKRAFT_POSTHOG_API_KEY }}
- -X unikraft.com/cli/internal/telemetry.PostHogHost={{ .Env.UNIKRAFT_POSTHOG_HOST }}
#@ end
#@ end
archives:
#@ for os, archs in oses.items():
#@ for arch in archs:
- id: #@ "archive-unikraft-cli-{}-{}".format(os, arch)
formats:
- tar.gz
name_template: unikraft-cli_{{ .Version }}_{{ .Os }}_{{ .Arch }}
ids:
- #@ "unikraft-{}-{}".format(os, arch)
files:
- src: .goreleaser-docs/man/*.1.gz
dst: docs/man
strip_parent: true
#@ end
#@ end
nfpms:
- id: deb
vendor: Unikraft
package_name: unikraft-cli
maintainer: Unikraft <support@unikraft.com>
description: Unikraft CLI
license: BSD-3-Clause
bindir: /usr/local/bin
homepage: https://unikraft.com
formats:
- deb
- rpm
- apk
contents:
- src: .goreleaser-docs/man/*.1.gz
dst: /usr/share/man/man1
epoch: #@ getattr(data.values, "DEB_EPOCH", "1")
prerelease: #@ getattr(data.values, "DEB_PRERELEASE", "")
version_metadata: #@ getattr(data.values, "DEB_METADATA", "")
release: #@ getattr(data.values, "DEB_RELEASE", "")