blob: 2bcb86accb26a8c034088b23636358d76de898c6 (
plain)
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
|
name: Build artifacts (manual)
on:
workflow_dispatch:
inputs:
build_group:
description: which artifacts to build
required: true
default: linux
type: choice
options:
- linux
- macos
- windows
- all
libghostty_optimize:
description: libghostty-vt optimize mode for this build
required: true
default: ReleaseSafe
type: choice
options:
- ReleaseSafe
- ReleaseFast
- ReleaseSmall
- Debug
libghostty_simd:
description: build libghostty-vt with SIMD-accelerated code paths
required: true
default: 'false'
type: choice
options:
- 'false'
- 'true'
permissions:
contents: read
actions: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-linux:
if: ${{ inputs.build_group == 'linux' || inputs.build_group == 'all' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: herdr-linux-x86_64
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
name: herdr-linux-aarch64
env:
LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }}
LIBGHOSTTY_VT_SIMD: ${{ inputs.libghostty_simd }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: ${{ matrix.target }}
- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
with:
version: 0.15.2
- name: Prefer official Ubuntu mirrors over Azure
run: |
if [ -f /etc/apt/apt-mirrors.txt ]; then
sudo sed -i '/azure.archive.ubuntu.com/d' /etc/apt/apt-mirrors.txt
echo "Using apt mirrors:"
cat /etc/apt/apt-mirrors.txt
fi
- name: Install Linux build tools
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build musl-tools gcc-aarch64-linux-gnu crossbuild-essential-arm64
- name: Set Linux aarch64 linker
if: matrix.target == 'aarch64-unknown-linux-musl'
run: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Remove Zig caches
run: rm -rf .zig-cache vendor/libghostty-vt/.zig-cache vendor/libghostty-vt/zig-out
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Package artifact
run: |
cp target/${{ matrix.target }}/release/herdr ${{ matrix.name }}
file ${{ matrix.name }} > BUILD_INFO.txt
ldd ${{ matrix.name }} 2>&1 | tee -a BUILD_INFO.txt
grep -q "statically linked" BUILD_INFO.txt
if nm -u ${{ matrix.name }} 2>/dev/null | grep -E '(__cxa|GLIBCXX|CXXABI|_ZSt)'; then
echo "error: Linux artifact has unresolved C++ runtime symbols" >&2
exit 1
fi
{
echo "commit=$GITHUB_SHA"
echo "target=${{ matrix.target }}"
echo "libghostty_vt_optimize=$LIBGHOSTTY_VT_OPTIMIZE"
echo "libghostty_vt_simd=$LIBGHOSTTY_VT_SIMD"
} >> BUILD_INFO.txt
python3 -c "import hashlib, pathlib; artifact = pathlib.Path('${{ matrix.name }}'); print(f'sha256={hashlib.sha256(artifact.read_bytes()).hexdigest()} {artifact.name}')" >> BUILD_INFO.txt
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ matrix.name }}-${{ inputs.libghostty_optimize }}-simd-${{ inputs.libghostty_simd }}
path: |
${{ matrix.name }}
BUILD_INFO.txt
retention-days: 7
build-macos:
if: ${{ inputs.build_group == 'macos' || inputs.build_group == 'all' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
name: herdr-macos-x86_64
- target: aarch64-apple-darwin
os: macos-latest
name: herdr-macos-aarch64
env:
LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }}
LIBGHOSTTY_VT_SIMD: ${{ inputs.libghostty_simd }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: ${{ matrix.target }}
- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
with:
version: 0.15.2
- name: Install macOS build tools
run: brew install cmake ninja
- name: Remove Zig caches
run: rm -rf .zig-cache vendor/libghostty-vt/.zig-cache vendor/libghostty-vt/zig-out
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Package artifact
run: |
cp target/${{ matrix.target }}/release/herdr ${{ matrix.name }}
file ${{ matrix.name }} > BUILD_INFO.txt
{
echo "commit=$GITHUB_SHA"
echo "target=${{ matrix.target }}"
echo "libghostty_vt_optimize=$LIBGHOSTTY_VT_OPTIMIZE"
echo "libghostty_vt_simd=$LIBGHOSTTY_VT_SIMD"
} >> BUILD_INFO.txt
python3 -c "import hashlib, pathlib; artifact = pathlib.Path('${{ matrix.name }}'); print(f'sha256={hashlib.sha256(artifact.read_bytes()).hexdigest()} {artifact.name}')" >> BUILD_INFO.txt
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ matrix.name }}-${{ inputs.libghostty_optimize }}-simd-${{ inputs.libghostty_simd }}
path: |
${{ matrix.name }}
BUILD_INFO.txt
retention-days: 7
build-windows:
if: ${{ inputs.build_group == 'windows' || inputs.build_group == 'all' }}
runs-on: windows-latest
env:
LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }}
LIBGHOSTTY_VT_SIMD: ${{ inputs.libghostty_simd }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: x86_64-pc-windows-msvc
- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
with:
version: 0.15.2
- name: Remove Zig caches
shell: pwsh
run: |
Remove-Item -Recurse -Force .zig-cache -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force vendor/libghostty-vt/.zig-cache -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force vendor/libghostty-vt/zig-out -ErrorAction SilentlyContinue
- name: Build
run: cargo build --release --locked --target x86_64-pc-windows-msvc
- name: Package artifact
shell: pwsh
run: |
Copy-Item target\x86_64-pc-windows-msvc\release\herdr.exe herdr-windows-x86_64.exe
"commit=$env:GITHUB_SHA" | Out-File -Encoding utf8 BUILD_INFO.txt
"target=x86_64-pc-windows-msvc" | Out-File -Encoding utf8 -Append BUILD_INFO.txt
"libghostty_vt_optimize=$env:LIBGHOSTTY_VT_OPTIMIZE" | Out-File -Encoding utf8 -Append BUILD_INFO.txt
"libghostty_vt_simd=$env:LIBGHOSTTY_VT_SIMD" | Out-File -Encoding utf8 -Append BUILD_INFO.txt
$hash = (Get-FileHash -Algorithm SHA256 herdr-windows-x86_64.exe).Hash.ToLowerInvariant()
"sha256=$hash herdr-windows-x86_64.exe" | Out-File -Encoding utf8 -Append BUILD_INFO.txt
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: herdr-windows-x86_64-${{ inputs.libghostty_optimize }}-simd-${{ inputs.libghostty_simd }}
path: |
herdr-windows-x86_64.exe
BUILD_INFO.txt
retention-days: 7
|