-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.36 KB
/
release.yml
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
name: 'Build and Release DEB Package'
on:
push:
tags:
- 'v*' # Trigger on version tags
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y qtbase5-dev qt5-qmake qttools5-dev-tools qtmultimedia5-dev \
build-essential debhelper devscripts
- name: Build Project
run: |
qmake
make
- name: Prepare Debian Package
run: |
mkdir -p debian/qstamina/DEBIAN
mkdir -p debian/qstamina/usr/share/qstamina
mkdir -p debian/qstamina/usr/share/applications
mkdir -p debian/qstamina/usr/bin
mkdir -p debian/qstamina/usr/share/icons
mkdir -p debian/qstamina/usr/share/icons/hicolor/16x16/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/32x32/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/48x48/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/128x128/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/256x256/apps
# Copy resources
cp -r src/resources/* debian/qstamina/usr/share/qstamina/
# Copy binary
cp QStamina debian/qstamina/usr/bin/qstamina
#copy deskop entry
mv debian/qstamina/usr/share/qstamina/qstamina.desktop debian/qstamina/usr/share/applications/qstamina.desktop
# Create control file
cat > debian/qstamina/DEBIAN/control << EOF
Package: qstamina
Version: ${GITHUB_REF_NAME#v}
Architecture: amd64
Maintainer: Zer0C00I
Depends: libqt5core5a, libqt5gui5, libqt5widgets5, libqtmultimedia5
Description: Typing tutor software
QStamina is a typing tutor that helps users improve their typing speed.
EOF
- name: Build DEB Package
run: |
cd debian/qstamina
dpkg-deb --build . ../qstamina_${GITHUB_REF_NAME#v}.deb
- name: Upload DEB Package
uses: actions/upload-artifact@v3
with:
name: qstamina-deb
path: debian/qstamina_*.deb
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: debian/qstamina_*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}