forked from fallenwood/kazeterm
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (157 loc) · 6.98 KB
/
ci.yaml
File metadata and controls
176 lines (157 loc) · 6.98 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
name: CI
on:
push:
branches: [ master ]
jobs:
build-release:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, windows-11-arm, ubuntu-24.04-arm, macos-latest, macos-26-intel]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set rust vesrion
run: rustup override set 1.95.0
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: "0.15.2"
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
!target/release-fast/build/libghostty-vt-sys-*
!target/release-fast/build/libghostty-vt-sys-*/**
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup
if: runner.os == 'Linux'
run: |
sudo apt-get update -y && sudo apt install -y \
clang \
llvm \
libxcb1-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
zstd
- name: Cleanup libghostty
shell: pwsh
run: |
Remove-Item -Path "./target/release-fast/build/libghostty-vt-sys-*" -Recurse -Force -ErrorAction SilentlyContinue
- name: Build
if: runner.os == 'Windows'
run: cargo build --profile=release-fast
- name: Build
if: runner.os != 'Windows'
run: cargo build --workspace --profile=release-fast
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Run coverage (tests included)
if: runner.os == 'Windows' && runner.arch != 'ARM64'
run: |
mkdir -p ./coverage
cargo llvm-cov --workspace --all-features --exclude terminal-kernel-vte --exclude terminal-kernel-ghostty --lcov --output-path coverage/lcov.info
- name: Run coverage (tests included)
if: runner.os != 'Windows'
run: |
mkdir -p ./coverage
cargo llvm-cov --workspace --all-features --lcov --output-path coverage/lcov.info
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
if: runner.os == 'Linux' && runner.arch == 'X64'
with:
name: coverage-lcov
path: coverage/lcov.info
- name: Pack
if: runner.os == 'Windows'
shell: pwsh
run: |
mkdir ./dists
mv target\release-fast\kazeterm.exe ./kazeterm.exe
$packDir = (Resolve-Path .).Path
$ghosttyLibName = 'ghostty-vt.dll'
$ghosttyLibs = @(
Get-ChildItem ./target/release-fast -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue
Get-ChildItem ./target/release-fast/build -Recurse -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like '*ghostty-install*' }
)
$ghosttyLib = $ghosttyLibs |
Sort-Object LastWriteTimeUtc, FullName -Descending |
Select-Object -First 1
if ($null -eq $ghosttyLib) {
throw "Missing ghostty-vt Windows runtime in target/release-fast or target/release-fast/build/**/ghostty-install/bin"
}
Write-Host "Using Ghostty runtime: $($ghosttyLib.FullName)"
Copy-Item $ghosttyLib.FullName -Destination $packDir -Force
$variant = "${{ runner.os}}-${{ runner.arch }}".ToLower()
7z a ./dists/kazeterm-$variant-${{ github.ref_name }}.7z ./kazeterm.exe $ghosttyLibName
- name: Pack
if: runner.os == 'Linux'
shell: pwsh
run: |
mkdir -p ./dists
$packDir = Join-Path (Resolve-Path .).Path "pack/linux"
New-Item -ItemType Directory -Force -Path $packDir | Out-Null
$variant = "${{ runner.os}}-${{ runner.arch }}".ToLower()
Copy-Item ./target/release-fast/kazeterm $packDir
$ghosttyLibName = 'libghostty-vt.so.0'
$ghosttyLibs = @(
Get-ChildItem ./target/release-fast -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue
Get-ChildItem ./target/release-fast/build -Recurse -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like '*ghostty-install*' }
)
$ghosttyLib = $ghosttyLibs |
Sort-Object LastWriteTimeUtc, FullName -Descending |
Select-Object -First 1
if ($null -eq $ghosttyLib) {
throw "Missing libghostty-vt Linux runtime in target/release-fast or target/release-fast/build/**/ghostty-install/lib"
}
Write-Host "Using Ghostty runtime: $($ghosttyLib.FullName)"
Copy-Item $ghosttyLib.FullName -Destination $packDir -Force
tar --zstd -cf ./dists/kazeterm-$variant-${{ github.ref_name }}.tar.zstd -C $packDir .
- name: Install cargo-bundle
if: runner.os == 'macOS'
run: cargo install cargo-bundle --locked
- name: Bundle macOS DMG
if: runner.os == 'macOS'
run: cargo bundle --profile=release-fast --format=osx -p kazeterm
- name: Pack
if: runner.os == 'macOS'
shell: pwsh
run: |
mkdir -p ./dists
$binPackDir = Join-Path (Resolve-Path .).Path "pack/macos-bin"
New-Item -ItemType Directory -Force -Path $binPackDir | Out-Null
$variant = "${{ runner.os}}-${{ runner.arch }}".ToLower()
Copy-Item ./target/release-fast/kazeterm $binPackDir
$ghosttyLibName = 'libghostty-vt.dylib'
$ghosttyLibs = @(
Get-ChildItem ./target/release-fast -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue
Get-ChildItem ./target/release-fast/build -Recurse -Filter $ghosttyLibName -File -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like '*ghostty-install*' }
)
$ghosttyLib = $ghosttyLibs |
Sort-Object LastWriteTimeUtc, FullName -Descending |
Select-Object -First 1
if ($null -eq $ghosttyLib) {
throw "Missing libghostty-vt macOS runtime in target/release-fast or target/release-fast/build/**/ghostty-install/lib"
}
Write-Host "Using Ghostty runtime: $($ghosttyLib.FullName)"
Copy-Item $ghosttyLib.FullName -Destination $binPackDir -Force
$frameworksDir = Join-Path (Resolve-Path ./target/release-fast/bundle/osx/Kazeterm.app).Path "Contents/Frameworks"
New-Item -ItemType Directory -Force -Path $frameworksDir | Out-Null
Copy-Item $ghosttyLib.FullName -Destination $frameworksDir -Force
tar -czf ./dists/kazeterm-$variant-${{ github.ref_name }}.tar.gz -C $binPackDir .
tar -czf ./dists/kazeterm-$variant-${{ github.ref_name }}-dmg.tar.gz -C ./target/release-fast/bundle/osx Kazeterm.app
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
tag_name: wip
prerelease: true
files: |
./dists/*