Skip to content

Commit 3ccac93

Browse files
committed
add:auto-build
1 parent 510ace2 commit 3ccac93

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

.github/workflows/build-linux.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Release Linux App
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-linux:
13+
runs-on: ubuntu-22.04
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install system dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y \
28+
libxcb-keysyms1 \
29+
libxcb-render-util0 \
30+
libxkbcommon-x11-0 \
31+
libxcb-xinerama0 \
32+
libxcb-image0 \
33+
libxcb-xkb1 \
34+
libxcb-shape0 \
35+
libxcb-icccm4 \
36+
appstream \
37+
libfuse2
38+
39+
- name: Install Python dependencies
40+
run: |
41+
pip install -r requirements.txt
42+
pip install pyinstaller
43+
44+
- name: Build Linux App
45+
run: |
46+
pyinstaller --noconfirm --onefile --windowed --name EduCollector \
47+
--add-data "src/themes:themes" \
48+
src/main.py
49+
50+
mkdir -p AppDir/usr/bin
51+
mkdir -p AppDir/usr/share/applications
52+
53+
cp dist/EduCollector AppDir/usr/bin/EduCollector
54+
55+
echo "[Desktop Entry]" > AppDir/EduCollector.desktop
56+
echo "Name=EduCollector" >> AppDir/EduCollector.desktop
57+
echo "Exec=EduCollector" >> AppDir/EduCollector.desktop
58+
echo "Type=Application" >> AppDir/EduCollector.desktop
59+
echo "Categories=Education;Science;" >> AppDir/EduCollector.desktop
60+
echo "Comment=Educational article collector" >> AppDir/EduCollector.desktop
61+
62+
echo '#!/bin/sh' > AppDir/AppRun
63+
echo 'exec "$APPDIR/usr/bin/EduCollector" "$@"' >> AppDir/AppRun
64+
chmod +x AppDir/AppRun
65+
66+
- name: Create AppImage
67+
run: |
68+
curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool
69+
chmod +x appimagetool
70+
./appimagetool AppDir
71+
mkdir -p dist
72+
mv EduCollector-x86_64.AppImage dist/
73+
74+
- name: Upload to GitHub Releases
75+
uses: softprops/action-gh-release@v1
76+
with:
77+
files: 'dist/EduCollector-x86_64.AppImage'
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-windows.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Release Windows App
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-windows:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install Python dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install pyinstaller
29+
30+
- name: Build Windows App
31+
run: |
32+
pyinstaller --noconfirm --onefile --windowed --name EduCollector ^
33+
--add-data "src/themes;themes" ^
34+
src/main.py
35+
36+
- name: Upload to GitHub Releases
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
files: 'dist/EduCollector.exe'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)