-
-
Notifications
You must be signed in to change notification settings - Fork 237
123 lines (106 loc) · 3.81 KB
/
linux-build.yml
File metadata and controls
123 lines (106 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
123
name: "Linux Build"
on:
workflow_dispatch:
inputs:
runner:
description: "Linux runner to build on"
required: true
default: "ubuntu-22.04"
type: choice
options:
- "ubuntu-22.04"
- "ubuntu-22.04-arm"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.runner || 'ubuntu-22.04' }}
cancel-in-progress: true
jobs:
build:
if: github.repository == 'athasdev/athas'
name: Build Linux tarball
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
timeout-minutes: 120
env:
CARGO_TERM_COLOR: always
CEF_PATH: ${{ github.workspace }}/.cache/tauri-cef
NO_STRIP: "true"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Free disk space
run: |
echo "Disk usage before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL || true
sudo docker system prune -af || true
sudo apt-get clean
echo "Disk usage after cleanup:"
df -h
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Cache CEF binaries
uses: actions/cache@v4
with:
path: .cache/tauri-cef
key: ${{ runner.os }}-${{ runner.arch }}-cef-v146.4.1
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils file
- name: Install Tauri CEF CLI
env:
RUSTFLAGS: "--cfg rustix_use_libc"
run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/cef --locked
- name: Install frontend dependencies
run: bun install --ignore-scripts && bun scripts/postinstall.ts
- name: Check Linux feature graph
run: |
set -euo pipefail
cargo tree -p athas --no-default-features --features linux -i tauri-runtime-cef
cargo tree -p athas --no-default-features --features linux -i tauri-runtime-wry >/tmp/tauri-runtime-wry.txt 2>&1 || true
if grep -q '^tauri-runtime-wry ' /tmp/tauri-runtime-wry.txt; then
echo "tauri-runtime-wry must not be present in the Linux build"
cat /tmp/tauri-runtime-wry.txt
exit 1
fi
cargo tree -p athas --no-default-features --features linux -i webkit2gtk >/tmp/webkit2gtk.txt 2>&1 || true
if grep -q '^webkit2gtk ' /tmp/webkit2gtk.txt; then
echo "webkit2gtk must not be present in the Linux build"
cat /tmp/webkit2gtk.txt
exit 1
fi
- name: Build Linux app
run: |
cargo tauri build \
--no-bundle \
--config '{"bundle":{"createUpdaterArtifacts":false}}' \
-- \
--no-default-features \
--features linux
- name: Package Linux tarball
run: bash scripts/release/package-linux-tarball.sh "${{ runner.arch }}" release-dist
- name: Upload Linux tarball
uses: actions/upload-artifact@v4
with:
name: linux-${{ runner.arch }}
path: release-dist/*.tar.gz
if-no-files-found: error