Skip to content

Commit f2adb1c

Browse files
committed
Merge branch 'github-actions'
2 parents cf86bc8 + 542a3e6 commit f2adb1c

File tree

11 files changed

+187
-23
lines changed

11 files changed

+187
-23
lines changed

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Dependabot file for actions
2+
# Copyright (C) 2022 Plnguins
3+
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
version: 2
18+
updates:
19+
- package-ecosystem: github-actions
20+
directory: "/"
21+
schedule:
22+
interval: daily
23+
target-branch: master
24+
assignees:
25+
- "VadVergasov"

.github/workflows/linux-build.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Github action script for building linux executables of this project
2-
# Copyright (C) 2022 Plnguins
2+
# Copyright (C) 2022 Plnguins
33

44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as published
@@ -17,6 +17,8 @@ name: Linux build
1717

1818
on:
1919
push:
20+
tags:
21+
- "*"
2022
paths-ignore:
2123
- "**.md"
2224
- "LICENSE"
@@ -90,8 +92,41 @@ jobs:
9092
-DBoost_LIBRARY_DIRS=${{ env.BOOST_DIR }}/boost/boost/lib
9193
- name: Build
9294
run: cmake --build ${{ github.workspace }}/build --parallel --config ${{ env.BUILD_TYPE }}
95+
- name: Download linuxdeploy
96+
run: |
97+
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O ${{ github.workspace }}/linuxdeploy.AppImage -q
98+
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage -O ${{ github.workspace }}/linuxdeploy-plugin-qt.AppImage -q
99+
chmod +x ${{ github.workspace }}/linuxdeploy.AppImage
100+
chmod +x ${{ github.workspace }}/linuxdeploy-plugin-qt.AppImage
101+
- name: Create app folder
102+
run: |
103+
mkdir -p ${{ github.workspace }}/app
104+
${{ github.workspace }}/linuxdeploy.AppImage --appdir ${{ github.workspace }}/build/bin/app -e ${{ github.workspace }}/build/bin/CRM --plugin qt
105+
cp -R ${{ github.workspace }}/build/bin/app/usr ${{ github.workspace }}/packages/com.pinguins.crm/data
106+
- name: Create installer
107+
run: ${{ env.IQTA_TOOLS }}/QtInstallerFramework/4.4/bin/binarycreator -c ${{ github.workspace }}/config/config.xml -p ${{ github.workspace }}/packages ${{ github.workspace }}/Linux-Setup -v
93108
- uses: actions/upload-artifact@v3
94109
name: Upload builded app
95110
with:
96-
name: CRM
97-
path: ${{ github.workspace }}/build/bin
111+
name: Linux
112+
path: ${{ github.workspace }}/Linux-Setup
113+
release:
114+
needs: linux
115+
name: Create\Update release
116+
runs-on: ubuntu-latest
117+
steps:
118+
- name: Download artifact
119+
uses: actions/download-artifact@v3
120+
with:
121+
name: Linux
122+
path: ${{ github.workspace }}/Linux
123+
- name: Create Release
124+
id: create_release
125+
uses: ncipollo/release-action@v1.10.0
126+
with:
127+
allowUpdates: true
128+
artifactErrorsFailBuild: true
129+
artifacts: "${{ github.workspace }}/Linux/Linux-Setup"
130+
name: ${{ github.event.head_commit.message }}
131+
draft: false
132+
prerelease: ${{ github.ref != 'refs/heads/master' }}

.github/workflows/macos-build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Github action script for building linux executables of this project
2+
# Copyright (C) 2022 VadVergasov as part of Plnguins
3+
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU Affero General Public License as published
6+
# by the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU Affero General Public License for more details.
13+
14+
# You should have received a copy of the GNU Affero General Public License
15+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
name: MacOS build
17+
18+
on:
19+
push:
20+
paths-ignore:
21+
- "**.md"
22+
- "LICENSE"
23+
- "README.md"
24+
- ".github/**"
25+
- "!.github/workflows/macos-build.yml"
26+
27+
env:
28+
BUILD_TYPE: Release
29+
QT_VERSION: "6.2.4"
30+
BOOST_VERSION: "1.79.0"
31+
QT_DIR: ${{ github.workspace }}
32+
BOOST_DIR: ${{ github.workspace }}
33+
34+
jobs:
35+
linux:
36+
name: MacOS
37+
runs-on: macos-latest
38+
strategy:
39+
matrix:
40+
arch: [x64]
41+
steps:
42+
- uses: actions/checkout@v3
43+
name: Clone
44+
with:
45+
submodules: recursive
46+
- name: Cache Qt
47+
id: cache-qt
48+
uses: actions/cache@v3
49+
with:
50+
path: ${{ env.QT_DIR }}/Qt
51+
key: ${{ runner.os }}-Qt-${{ env.QT_VERSION }}-${{ env.QT_DIR }}
52+
- name: Cache Boost
53+
id: cache-boost
54+
uses: actions/cache@v3
55+
with:
56+
path: ${{ env.BOOST_DIR }}/boost/boost
57+
key: ${{ runner.os }}-Boost-${{ env.BOOST_VERSION }}-${{ env.BOOST_DIR }}
58+
- name: Install Qt
59+
uses: jurplel/install-qt-action@v2
60+
with:
61+
cached: ${{ steps.cache-qt.outputs.cache-hit }}
62+
version: ${{ env.QT_VERSION }}
63+
dir: ${{ env.QT_DIR }}
64+
host: "mac"
65+
target: "desktop"
66+
setup-python: "false"
67+
- name: Install boost
68+
id: install-boost
69+
if: steps.cache-boost.outputs.cache-hit != 'true'
70+
uses: MarkusJx/install-boost@v2.3.0
71+
with:
72+
boost_version: ${{ env.BOOST_VERSION }}
73+
platform_version: 11
74+
toolset: clang
75+
boost_install_dir: ${{ env.BOOST_DIR }}
76+
- name: Configure CMake
77+
run: |
78+
cmake -B ${{ github.workspace }}/build \
79+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
80+
-DBoost_INCLUDE_DIR=${{ env.BOOST_DIR }}/boost/boost/include \
81+
-DBoost_LIBRARY_DIRS=${{ env.BOOST_DIR }}/boost/boost/lib
82+
- name: Build
83+
run: cmake --build ${{ github.workspace }}/build --parallel --config ${{ env.BUILD_TYPE }}
84+
- uses: actions/upload-artifact@v3
85+
name: Upload builded app
86+
with:
87+
name: CRM
88+
path: ${{ github.workspace }}/build/bin

.github/workflows/windows-build.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Github action script for building windows executables of this project
2-
# Copyright (C) 2022 Plnguins
2+
# Copyright (C) 2022 Plnguins
33

44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as published
@@ -17,6 +17,8 @@ name: Windows build
1717

1818
on:
1919
push:
20+
tags:
21+
- "*"
2022
paths-ignore:
2123
- "docs/**"
2224
- "**.md"
@@ -87,9 +89,29 @@ jobs:
8789
- name: Build
8890
run: cmake --build ${{ github.workspace }}/build --parallel --config ${{ env.BUILD_TYPE }}
8991
- name: Create Setup
90-
run: ${{ env.IQTA_TOOLS }}\QtInstallerFramework\4.4\bin\binarycreator.exe -c config\config.xml -p packages Setup.exe -v
92+
run: ${{ env.IQTA_TOOLS }}\QtInstallerFramework\4.4\bin\binarycreator.exe -c config\config.xml -p packages Windows-Setup.exe -v
9193
- uses: actions/upload-artifact@v3
9294
name: Upload builded app
9395
with:
94-
name: CRM
95-
path: ${{ github.workspace }}/Setup.exe
96+
name: Windows
97+
path: ${{ github.workspace }}/Windows-Setup.exe
98+
release:
99+
needs: windows
100+
name: Create\Update release
101+
runs-on: ubuntu-latest
102+
steps:
103+
- name: Download artifact
104+
uses: actions/download-artifact@v3
105+
with:
106+
name: Windows
107+
path: ${{ github.workspace }}/Windows
108+
- name: Create Release
109+
id: create_release
110+
uses: ncipollo/release-action@v1.10.0
111+
with:
112+
allowUpdates: true
113+
artifactErrorsFailBuild: true
114+
artifacts: "${{ github.workspace }}/Windows/Windows-Setup.exe"
115+
name: ${{ github.event.head_commit.message }}
116+
draft: false
117+
prerelease: ${{ github.ref != 'refs/heads/master' }}

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ IF(WIN32)
8484
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt6::Widgets> $<TARGET_FILE_DIR:CRM>
8585
COMMAND ${CMAKE_COMMAND} -E copy_directory ${QT6_INSTALL_PREFIX}/plugins/platforms $<TARGET_FILE_DIR:CRM>/platforms
8686
)
87+
add_custom_command(TARGET CRM POST_BUILD
88+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin ${CMAKE_SOURCE_DIR}/packages/com.pinguins.crm/data)
8789
ENDIF()
8890

8991
set_target_properties(CRM PROPERTIES
9092
WIN32_EXECUTABLE ON
9193
MACOSX_BUNDLE ON
9294
)
9395

94-
add_custom_command(TARGET CRM POST_BUILD
95-
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin ${CMAKE_SOURCE_DIR}/packages/com.pinguins.crm/data)
9696
add_custom_command(TARGET CRM POST_BUILD
9797
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/LICENSE.txt ${CMAKE_SOURCE_DIR}/packages/com.pinguins.crm/meta/LICENSE.txt)

CRM/leader/leader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ leader::leader(QMainWindow *parent)
4747

4848
ui->textEdit->clear();
4949

50-
QPixmap pixmap(":/main.ico");
51-
ui->Icon->setPixmap(pixmap);
50+
QPixmap icon(":/images/main.png");
51+
ui->Icon->setPixmap(icon.scaled(ui->Icon->size(), Qt::KeepAspectRatio));
5252
}
5353

5454
leader::~leader() { delete ui; }

CRM/main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
int main(int argc, char* argv[]) {
2222
QApplication a(argc, argv);
23-
QTranslator translator;
24-
translator.load(QString("QtLanguage_") + QString("ru_RU"));
25-
qApp->installTranslator(&translator);
2623
MainWindow w;
2724
w.show();
2825
return a.exec();

CRM/manager/manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ manager::manager(QMainWindow *parent)
4343

4444
ui->textEdit->clear();
4545

46-
QPixmap pixmap(":/main.ico");
47-
ui->Icon->setPixmap(pixmap);
46+
QPixmap icon(":/images/main.png");
47+
ui->Icon->setPixmap(icon.scaled(ui->Icon->size(), Qt::KeepAspectRatio));
4848
}
4949

5050
manager::~manager() { delete ui; }

CRM/marketer/marketer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ marketer::marketer(QWidget *parent)
3939

4040
ui->textEdit->clear();
4141

42-
QPixmap pixmap(":/main.ico");
43-
ui->Icon->setPixmap(pixmap);
42+
QPixmap icon(":/images/main.png");
43+
ui->Icon->setPixmap(icon.scaled(ui->Icon->size(), Qt::KeepAspectRatio));
4444
}
4545

4646
marketer::~marketer() { delete ui; }

CRM/seller/seller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ seller::seller(QMainWindow *parent)
4343

4444
ui->textEdit->clear();
4545

46-
QPixmap pixmap(":/main.ico");
47-
ui->Icon->setPixmap(pixmap);
46+
QPixmap icon(":/images/main.png");
47+
ui->Icon->setPixmap(icon.scaled(ui->Icon->size(), Qt::KeepAspectRatio));
4848
}
4949

5050
seller::~seller() { delete ui; }

0 commit comments

Comments
 (0)