-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (128 loc) · 5.01 KB
/
linux-build.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
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
# Github action script for building linux executables of this project
# Copyright (C) 2022 Plnguins
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
name: Linux build
on:
push:
tags:
- "*"
branches-ignore:
- "dependabot/**"
paths-ignore:
- "**.md"
- "LICENSE.txt"
- "README.md"
- ".github/**"
- "!.github/workflows/linux-build.yml"
pull_request:
paths-ignore:
- "**.md"
- "LICENSE.txt"
- "README.md"
- ".github/**"
- "!.github/workflows/linux-build.yml"
env:
BUILD_TYPE: Debug
QT_VERSION: "6.2.4"
QT_DIR: ${{ github.workspace }}
QT_ARCH: "gcc_64"
QT_TOOLS: "tools_ifw"
BOOST_PLATFORM: 20.04
BOOST_DIR: ${{ github.workspace }}
BOOST_VERSION: "1.79.0"
jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [x64]
steps:
- name: Change to Release if tag
if: startsWith(github.ref, 'refs/tags/')
run: echo "BUILD_TYPE=Release" >> $GITHUB_ENV
- uses: actions/checkout@v3
name: Clone
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa
with:
cache: true
cache-key-prefix: ${{ runner.os }}-Qt-${{ env.QT_VERSION }}-${{ env.QT_DIR }}-${{ env.QT_ARCH }}-${{ env.QT_TOOLS }}
version: ${{ env.QT_VERSION }}
dir: ${{ env.QT_DIR }}
host: "linux"
arch: ${{ env.QT_ARCH }}
target: "desktop"
setup-python: "false"
tools: ${{ env.QT_TOOLS }}
- name: Install PostgreSQL and cmake
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cmake postgresql libpq-dev g++ build-essential libxkbcommon-dev
- name: Install boost
id: install-boost
uses: MarkusJx/[email protected]
with:
boost_version: ${{ env.BOOST_VERSION }}
platform_version: ${{ env.BOOST_PLATFORM }}
toolset: gcc
boost_install_dir: ${{ env.BOOST_DIR }}
cache: true
- name: Configure CMake
run: |
cmake -B ${{ github.workspace }}/build \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DBoost_INCLUDE_DIR=${{ env.BOOST_DIR }}/boost/boost/include \
-DBoost_LIBRARY_DIRS=${{ env.BOOST_DIR }}/boost/boost/lib
- name: Build
run: cmake --build ${{ github.workspace }}/build --parallel --config ${{ env.BUILD_TYPE }}
- name: Download linuxdeploy
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O ${{ github.workspace }}/linuxdeploy.AppImage -q
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
chmod +x ${{ github.workspace }}/linuxdeploy.AppImage
chmod +x ${{ github.workspace }}/linuxdeploy-plugin-qt.AppImage
- name: Create app folder
run: |
mkdir -p ${{ github.workspace }}/app
${{ github.workspace }}/linuxdeploy.AppImage --appdir ${{ github.workspace }}/build/bin/app -e ${{ github.workspace }}/build/bin/CRM --plugin qt
cp -R ${{ github.workspace }}/build/bin/app/usr ${{ github.workspace }}/packages/com.pinguins.crm/data
- name: Create installer
run: ${{ env.IQTA_TOOLS }}/QtInstallerFramework/4.5/bin/binarycreator -c ${{ github.workspace }}/config/config.xml -p ${{ github.workspace }}/packages ${{ github.workspace }}/Linux-Setup -v
- uses: actions/upload-artifact@v3
name: Upload builded app
with:
name: Linux
path: ${{ github.workspace }}/Linux-Setup
release:
if: startsWith(github.ref, 'refs/tags/')
needs: linux
name: Create\Update release
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: Linux
path: ${{ github.workspace }}/Linux
- name: Create Release
id: create_release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "${{ github.workspace }}/Linux/Linux-Setup"
name: ${{ github.event.head_commit.message }}
draft: false
prerelease: startsWith(github.ref, 'refs/tags/')