-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
122 lines (111 loc) · 3.81 KB
/
Copy path.goreleaser.yaml
File metadata and controls
122 lines (111 loc) · 3.81 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
# GoReleaser config. Docs: https://goreleaser.com
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
before:
hooks:
- go mod tidy
- go generate ./...
# The release runs on a macOS arm64 runner (see cut-release.yml) so the
# `xurl chat` XChat client — which requires cgo to link the chat-xdk static
# libraries — can be compiled into every platform chat-xdk supports:
#
# darwin/arm64 native cgo build
# darwin/amd64 cgo cross-build with Apple clang (-arch x86_64)
# linux/amd64 cgo cross-build with `zig cc` against chat-xdk's musl
# static lib, fully statically linked so the one binary
# runs on both glibc and musl distros
#
# Platforms chat-xdk has no library for (windows/*, linux/arm64, linux/386)
# are built with CGO_ENABLED=0 and ship the graceful `xurl chat` stub.
builds:
- id: darwin-cgo
targets:
- darwin_arm64
- darwin_amd64
env:
- CGO_ENABLED=1
ldflags:
- -s -w
- -X github.com/xdevplatform/xurl/version.Version={{.Version}}
- -X github.com/xdevplatform/xurl/version.Commit={{.Commit}}
- -X github.com/xdevplatform/xurl/version.BuildDate={{.Date}}
hooks:
post:
# Ad-hoc sign so both darwin binaries carry a valid signature. The
# native arm64 build is already linker-signed, but the cross-built
# amd64 binary comes out unsigned. No Apple credentials involved;
# Gatekeeper quarantine is handled per install channel (the Homebrew
# cask strips it, and npm's programmatic download never sets it).
- cmd: codesign -s - --force {{ .Path }}
- id: linux-cgo
targets:
- linux_amd64
env:
- CGO_ENABLED=1
- CC=zig cc -target x86_64-linux-musl
# The musl tag selects chat-xdk's linux_amd64_musl static library.
flags:
- -tags=musl
ldflags:
- -s -w
- -X github.com/xdevplatform/xurl/version.Version={{.Version}}
- -X github.com/xdevplatform/xurl/version.Commit={{.Commit}}
- -X github.com/xdevplatform/xurl/version.BuildDate={{.Date}}
- -linkmode external
# Static link against musl so the binary has no runtime libc
# dependency; -lunwind provides the unwinder symbols the Rust-built
# chat-xdk library needs (zig bundles LLVM's libunwind).
- -extldflags "-static -lunwind"
- id: stub
targets:
- linux_arm64
- linux_386
- windows_amd64
- windows_arm64
- windows_386
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/xdevplatform/xurl/version.Version={{.Version}}
- -X github.com/xdevplatform/xurl/version.Commit={{.Commit}}
- -X github.com/xdevplatform/xurl/version.BuildDate={{.Date}}
archives:
- formats: [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
formats: [zip]
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
homebrew_casks:
- name: xurl
repository:
owner: xdevplatform
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
homepage: "https://github.com/xdevplatform/xurl"
description: "Auth-enabled curl-like CLI for the X API"
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/xurl"]
end
release:
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).