forked from aaif-goose/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
245 lines (218 loc) · 8.09 KB
/
bundle-desktop-linux.yml
File metadata and controls
245 lines (218 loc) · 8.09 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
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
236
237
238
239
240
241
242
243
244
245
# This is a **reuseable** workflow that bundles the Desktop App for Linux.
# It doesn't get triggered on its own. It gets used in multiple workflows:
# - release.yml
# - canary.yml (when added)
# - pr-comment-bundle-desktop.yml (when added)
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch name to bundle app from'
required: true
type: string
workflow_call:
inputs:
version:
description: 'Version to set for the build'
required: false
default: ""
type: string
ref:
type: string
required: false
default: ''
name: "Bundle Desktop (Linux)"
jobs:
build-desktop-linux:
name: Build Desktop (Linux, ${{ matrix.variant }})
runs-on: ${{ matrix.build-on }}
strategy:
fail-fast: false
matrix:
include:
- variant: standard
build-on: ubuntu-22.04
- variant: vulkan
build-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref || inputs.branch }}
- name: Update versions
if: ${{ inputs.version != '' }}
run: |
# Update version in Cargo.toml
sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml
rm -f Cargo.toml.bak
# Update version in package.json
source ./bin/activate-hermit
cd ui/desktop
npm pkg set "version=${{ inputs.version }}"
- name: Debug workflow info
env:
WORKFLOW_NAME: ${{ github.workflow }}
WORKFLOW_REF: ${{ github.ref }}
EVENT_NAME: ${{ github.event_name }}
REPOSITORY: ${{ github.repository }}
run: |
echo "=== Workflow Information ==="
echo "Workflow: ${WORKFLOW_NAME}"
echo "Ref: ${WORKFLOW_REF}"
echo "Event: ${EVENT_NAME}"
echo "Repo: ${REPOSITORY}"
echo ""
echo "=== System Information ==="
uname -a
lsb_release -a || true
df -h
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libnss3-dev \
libatk-bridge2.0-dev \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libgbm1 \
libxss1 \
rpm \
fakeroot \
dpkg-dev \
protobuf-compiler \
flatpak \
flatpak-builder \
elfutils
if [ "${{ matrix.variant }}" = "vulkan" ]; then
sudo apt-get install -y \
libasound2t64 \
libvulkan-dev \
libvulkan1 \
glslc
else
sudo apt-get install -y libasound2
fi
- name: Setup Flatpak Runtimes
run: |
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Activate hermit and set CARGO_HOME
run: |
source bin/activate-hermit
echo "CARGO_HOME=$CARGO_HOME" >> $GITHUB_ENV
echo "RUSTUP_HOME=$RUSTUP_HOME" >> $GITHUB_ENV
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: linux-${{ matrix.build-on }}-${{ matrix.variant }}
- name: Build goosed binary
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
run: |
source ./bin/activate-hermit
export TARGET="x86_64-unknown-linux-gnu"
rustup target add "${TARGET}"
FEATURE_ARGS=()
if [ "${{ matrix.variant }}" = "vulkan" ]; then
FEATURE_ARGS=(--features vulkan)
fi
cargo build --release --target ${TARGET} -p goose-server "${FEATURE_ARGS[@]}"
- name: Copy binaries into Electron folder
run: |
echo "Copying binaries to ui/desktop/src/bin/"
export TARGET="x86_64-unknown-linux-gnu"
mkdir -p ui/desktop/src/bin
cp target/$TARGET/release/goosed ui/desktop/src/bin/
chmod +x ui/desktop/src/bin/goosed
ls -la ui/desktop/src/bin/
- name: Cache pnpm dependencies
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
ui/desktop/node_modules
.hermit/node/cache
key: linux-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }}
restore-keys: |
linux-pnpm-cache-v1-${{ runner.os }}-
- name: Install pnpm dependencies
run: |
source ./bin/activate-hermit
cd ui/desktop
pnpm install --frozen-lockfile
# Verify installation
ls -la node_modules/.bin/ | head -5
- name: Build Linux packages
env:
GOOSE_DESKTOP_LINUX_VARIANT: ${{ matrix.variant }}
run: |
source ./bin/activate-hermit
cd ui/desktop
echo "Building Linux packages (.deb, .rpm, and .flatpak) for ${{ matrix.variant }}..."
# Build all configured packages
pnpm run make --platform=linux --arch=x64
if [ "${{ matrix.variant }}" = "vulkan" ]; then
for package in out/make/deb/x64/*.deb out/make/rpm/x64/*.rpm out/make/flatpak/x86_64/*.flatpak; do
[ -e "$package" ] || continue
extension="${package##*.}"
base="${package%.*}"
mv "$package" "${base}-vulkan.${extension}"
done
fi
echo "Build completed. Checking output..."
ls -la out/
find out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" | head -10
- name: List generated files
run: |
echo "=== All files in out/ directory ==="
find ui/desktop/out/ -type f | head -20
echo ""
echo "=== Package files specifically ==="
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak"
echo ""
echo "=== File sizes ==="
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" -exec ls -lh {} \;
- name: Upload .deb package
if: matrix.variant == 'standard'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-deb
path: ui/desktop/out/make/deb/x64/*.deb
if-no-files-found: error
- name: Upload .deb package (Vulkan)
if: matrix.variant == 'vulkan'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-vulkan-deb
path: ui/desktop/out/make/deb/x64/*-vulkan.deb
if-no-files-found: error
- name: Upload .rpm package
if: matrix.variant == 'standard'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-rpm
path: ui/desktop/out/make/rpm/x64/*.rpm
if-no-files-found: error
- name: Upload .rpm package (Vulkan)
if: matrix.variant == 'vulkan'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-vulkan-rpm
path: ui/desktop/out/make/rpm/x64/*-vulkan.rpm
if-no-files-found: error
- name: Upload .flatpak package
if: matrix.variant == 'standard'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-flatpak
path: ui/desktop/out/make/flatpak/x86_64/*.flatpak
if-no-files-found: error
- name: Upload .flatpak package (Vulkan)
if: matrix.variant == 'vulkan'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-linux-x64-vulkan-flatpak
path: ui/desktop/out/make/flatpak/x86_64/*-vulkan.flatpak
if-no-files-found: error