-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (121 loc) · 4.19 KB
/
gui-release.yml
File metadata and controls
142 lines (121 loc) · 4.19 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
name: GUI Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-gui:
name: Build GUI (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x64
os: ubuntu-latest
artifact_name: docstruct-gui-linux-x64
- name: windows-x64
os: windows-latest
artifact_name: docstruct-gui-windows-x64
- name: macos-intel
os: macos-latest
artifact_name: docstruct-gui-macos-intel
- name: macos-apple-silicon
os: macos-14
artifact_name: docstruct-gui-macos-apple-silicon
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libwayland-dev \
libwayland-client0 \
wayland-protocols \
libxkbcommon-dev \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-kor \
poppler-utils \
python3 \
python3-pip \
python3-venv
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install tesseract poppler python@3.11
- name: Setup Python (Linux/macOS)
if: runner.os != 'Windows'
run: |
python3 -m pip install --upgrade pip --break-system-packages || true
pip3 install -r requirements.txt --break-system-packages || true
- name: Setup Python (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip || echo "pip upgrade failed"
pip install -r requirements.txt || echo "requirements.txt installation failed, continuing..."
- name: Build main project first
run: cargo build --release
continue-on-error: true
- name: Install Tauri CLI
run: cargo install tauri-cli --version '^2.0' --locked
- name: Build GUI bundle (Linux)
if: runner.os == 'Linux'
working-directory: gui/src-tauri
run: cargo tauri build -b deb,rpm
- name: Build GUI bundle (Windows/macOS)
if: runner.os != 'Linux' && matrix.name != 'macos-intel'
working-directory: gui/src-tauri
run: cargo tauri build
- name: Build GUI bundle (macOS Intel)
if: matrix.name == 'macos-intel'
working-directory: gui/src-tauri
run: cargo tauri build --bundles app
- name: Upload GUI bundle artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
gui/src-tauri/target/release/bundle/**
if-no-files-found: error
publish-gui:
name: Publish GUI Installers
runs-on: ubuntu-latest
needs: build-gui
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download GUI artifacts
uses: actions/download-artifact@v4
with:
pattern: docstruct-gui-*
path: gui-release-assets
merge-multiple: true
- name: Verify GUI assets
run: |
ls -lah gui-release-assets
test -n "$(find gui-release-assets -type f | head -n 1)"
- name: Upload GUI installers to release
run: |
gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1 || \
gh release create "${GITHUB_REF_NAME}" --title "${GITHUB_REF_NAME}" --notes ""
find gui-release-assets -type f \
\( -name "*.msi" -o -name "*.exe" -o -name "*.dmg" -o -name "*.app.tar.gz" -o -name "*.zip" -o -name "*.deb" -o -name "*.rpm" \) \
-print0 | xargs -0 -r gh release upload "${GITHUB_REF_NAME}" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}