-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
155 lines (140 loc) · 4.43 KB
/
Copy path.goreleaser.yaml
File metadata and controls
155 lines (140 loc) · 4.43 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
# Copyright 2023 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# All builds set CGO_ENABLED=1 — audio (portaudio/webrtc APM) is in every
# binary. Linux/Windows cross-compiles use zig cc as the C/C++ toolchain;
# scripts/setup-cross.sh builds static libasound.a (linux) and pre-generates
# MinGW import libs (windows) under .cross/<target>/ before each build.
version: 2
before:
hooks:
- go mod tidy
builds:
# darwin can't be cross-compiled from Linux (no macOS SDK / CoreAudio); it
# builds where goreleaser runs (the macOS release runner). On the arm64 macOS
# runner, amd64 cross-compiles via Apple clang's -arch against the universal
# SDK. The build.yaml smoke test builds both arches the same way.
- id: lk-darwin
main: ./cmd/lk
binary: lk
env:
- CGO_ENABLED=1
goos: [darwin]
goarch: [amd64, arm64]
ldflags:
- -s -w
- id: lk-linux-amd64
main: ./cmd/lk
binary: lk
hooks:
pre:
- cmd: scripts/setup-cross.sh linux/amd64
env:
- CGO_ENABLED=1
- CC=zig cc -target x86_64-linux-gnu.2.28
- CXX=zig c++ -target x86_64-linux-gnu.2.28
- CGO_CFLAGS=-I{{ .Env.PWD }}/.cross/linux_amd64/include
# -L points at scripts/setup-cross.sh's static libasound.a. zig's sysroot
# excludes /usr/lib so the `-lasound` from #cgo LDFLAGS resolves here.
- CGO_LDFLAGS=-L{{ .Env.PWD }}/.cross/linux_amd64/lib
goos: [linux]
goarch: [amd64]
ldflags:
- -s -w
- -linkmode=external
- id: lk-linux-arm64
main: ./cmd/lk
binary: lk
hooks:
pre:
- cmd: scripts/setup-cross.sh linux/arm64
env:
- CGO_ENABLED=1
- CC=zig cc -target aarch64-linux-gnu.2.28
- CXX=zig c++ -target aarch64-linux-gnu.2.28
- CGO_CFLAGS=-I{{ .Env.PWD }}/.cross/linux_arm64/include
- CGO_LDFLAGS=-L{{ .Env.PWD }}/.cross/linux_arm64/lib
goos: [linux]
goarch: [arm64]
ldflags:
- -s -w
- -linkmode=external
- id: lk-windows-amd64
main: ./cmd/lk
binary: lk
hooks:
pre:
- cmd: scripts/setup-cross.sh windows/amd64
env:
- CGO_ENABLED=1
- CC=zig cc -target x86_64-windows-gnu
- CXX=zig c++ -target x86_64-windows-gnu
# SEH (-fms-extensions) and -DNTDDI_VERSION live in the source #cgo windows
# directives so native and cross builds agree; -fms-extensions isn't on
# cgo's directive allowlist, so unlock it here. -fno-sanitize=all is a
# zig-0.16-specific workaround for unresolved UBSan symbols under lld.
- CGO_CXXFLAGS_ALLOW=-fms-extensions
- CGO_CXXFLAGS=-fno-sanitize=all
goos: [windows]
goarch: [amd64]
ldflags:
- -s -w
- -linkmode=external
- -extldflags=-L{{ .Env.PWD }}/.cross/windows_amd64/mingw_lib
- id: lk-windows-arm64
main: ./cmd/lk
binary: lk
hooks:
pre:
- cmd: scripts/setup-cross.sh windows/arm64
env:
- CGO_ENABLED=1
- CC=zig cc -target aarch64-windows-gnu
- CXX=zig c++ -target aarch64-windows-gnu
- CGO_CXXFLAGS_ALLOW=-fms-extensions
- CGO_CXXFLAGS=-fno-sanitize=all
goos: [windows]
goarch: [arm64]
ldflags:
- -s -w
- -linkmode=external
- -extldflags=-L{{ .Env.PWD }}/.cross/windows_arm64/mingw_lib
archives:
- name_template: "lk_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
formats: [zip]
files:
- LICENSE
- 'autocomplete/*'
# Docker images are built+pushed by a separate job in release.yaml (on a Linux
# runner with a Docker daemon), since goreleaser runs on macOS here to build the
# darwin binary natively and macOS runners have no Docker.
release:
github:
owner: livekit
name: livekit-cli
draft: true
prerelease: auto
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
gomod:
proxy: false
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: "{{ incpatch .Version }}-next"