-
Notifications
You must be signed in to change notification settings - Fork 63
80 lines (65 loc) · 2.17 KB
/
Copy pathbuild-linux.yml
File metadata and controls
80 lines (65 loc) · 2.17 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
name: Build - Linux
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux:
name: Build Linux (Ubuntu)
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y libarchive-tools
- name: Build Electron app for Linux
run: npm run electron:build:linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify build artifacts
run: |
echo "=== Checking deb ==="
shopt -s nullglob
DEBS=(release/*.deb)
if [ ${#DEBS[@]} -eq 0 ]; then echo "ERROR: No .deb found"; exit 1; fi
for DEB in "${DEBS[@]}"; do
echo "deb: $DEB ($(stat --format=%s "$DEB") bytes)"
echo "=== Checking deb metadata ==="
dpkg-deb --info "$DEB"
echo "=== Checking deb contains dorothy binary ==="
MAIN_BIN=$(dpkg-deb --contents "$DEB" | grep -m1 "opt/Dorothy/dorothy$")
if [ -z "$MAIN_BIN" ]; then echo "ERROR: dorothy binary not found in deb"; exit 1; fi
BIN_SIZE=$(echo "$MAIN_BIN" | awk '{print $3}')
echo "Main binary: $(echo "$MAIN_BIN" | awk '{print $NF}') ($BIN_SIZE bytes)"
if [ "$BIN_SIZE" -eq 0 ]; then echo "ERROR: dorothy binary is zero-size"; exit 1; fi
done
echo "=== All checks passed ==="
- name: Upload deb artifact
uses: actions/upload-artifact@v4
with:
name: Dorothy-Linux-deb-${{ matrix.arch }}
path: release/*.deb
if-no-files-found: warn
- name: Upload to GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
release/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}