This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
generated from Qv2ray/QvPlugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 128
160 lines (157 loc) · 7 KB
/
build-simpleplugin-qt6.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: QvPlugin Build Action Qt6 - cmake
on:
push:
release:
types: [prereleased]
jobs:
build:
strategy:
matrix:
qt_version: [6.0.0]
platform: [ubuntu-20.04, macos-latest, windows-latest]
include:
- platform: windows-latest
qtarch: win64_msvc2019_64
fail-fast: false
runs-on: ${{ matrix.platform }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Get the version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Get Plugin Name
id: get_name
shell: bash
run: echo ::set-output name=NAME::QvPlugin-Trojan
- name: Checking out sources
uses: actions/checkout@master
- name: Install Python 3.7 version
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Restoring submodules
run: git submodule update --init
# =========================================================================================================
- name: Install Packages - macOS
if: matrix.platform == 'macos-latest'
run: |
brew install boost [email protected] zlib
- name: Install Packages - Linux
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libboost-system1.71-dev libboost-program-options1.71-dev
- name: Install MSVC compiler
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
arch: x64
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: QtCache-${{ matrix.platform }}-${{ matrix.qt_version }}
- name: Installing Qt - ${{ matrix.arch }}
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_version }}
arch: ${{ matrix.qtarch }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
# =========================================================================================================
- name: Linux - ${{ matrix.qt_version }} - Build preparation - Install Packages
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt update
sudo apt install -y libgl-dev libx11-dev libxkbcommon-x11-dev libxcb-image0-dev libxcb-icccm4-dev libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0
# ========================================================================================================= Generate MakeFile and Build
- name: Windows - ${{ matrix.qt_version }} - Generate Dependencies and Build
shell: bash
if: matrix.platform == 'windows-latest'
env:
CC: cl.exe
CXX: cl.exe
run: |
choco install openssl > openssl_installer.log
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -A x64 -DQVPLUGIN_USE_QT6=ON -DBoost_USE_STATIC_LIBS=ON -DBoost_INCLUDE_DIR="${BOOST_ROOT_1_72_0}/include"
cmake --build . --parallel $(nproc) --config Release
# --------------------------------------------------------
- name: macOS - ${{ matrix.qt_version }} - Generate Dependencies and Build
shell: bash
if: matrix.platform == 'macos-latest'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DOPENSSL_ROOT_DIR=/usr/local/opt/[email protected] \
-DOPENSSL_LIBRARIES=/usr/local/opt/[email protected]/lib \
-DBoost_USE_STATIC_LIBS=ON \
-DOPENSSL_USE_STATIC_LIBS=ON \
-DQVPLUGIN_USE_QT6=ON
cmake --build . --parallel $(sysctl -n hw.logicalcpu)
# --------------------------------------------------------
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'ubuntu-20.04'
shell: bash
env:
CC: gcc-7
CXX: g++-7
CXXFLAGS: -fno-sized-deallocation
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQVPLUGIN_USE_QT6=ON -DBoost_USE_STATIC_LIBS=ON -DFORCE_TCP_FASTOPEN=ON
cmake --build . --parallel $(nproc)
# ========================================================================================================= Deployments
- name: Win - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@master
with:
name: ${{ steps.get_name.outputs.NAME }}-${{ github.sha }}.Windows.Qt${{ matrix.qt_version }}.dll
path: build/Release/${{ steps.get_name.outputs.NAME }}.dll
- name: Win - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'windows-latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/Release/${{ steps.get_name.outputs.NAME }}.dll
asset_name: ${{ steps.get_name.outputs.NAME }}.${{ steps.get_version.outputs.VERSION }}.Windows.Qt6.dll
tag: ${{ github.ref }}
overwrite: true
# --------------------------------------------------------
- name: macOS - ${{ matrix.qt_version }} - Uploading Artifact
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@master
with:
name: ${{ steps.get_name.outputs.NAME }}-${{ github.sha }}.macOS.Qt${{ matrix.qt_version }}.so
path: build/lib${{ steps.get_name.outputs.NAME }}.so
- name: macOS - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'macos-latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/lib${{ steps.get_name.outputs.NAME }}.so
asset_name: ${{ steps.get_name.outputs.NAME }}.${{ steps.get_version.outputs.VERSION }}.macOS.Qt6.so
tag: ${{ github.ref }}
overwrite: true
# --------------------------------------------------------
- name: Linux - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'ubuntu-20.04'
uses: actions/upload-artifact@master
with:
name: ${{ steps.get_name.outputs.NAME }}-${{ github.sha }}.Linux.Qt${{ matrix.qt_version }}.so
path: build/lib${{ steps.get_name.outputs.NAME }}.so
- name: Linux - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'ubuntu-20.04'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/lib${{ steps.get_name.outputs.NAME }}.so
asset_name: ${{ steps.get_name.outputs.NAME }}.${{ steps.get_version.outputs.VERSION }}.Linux.Qt6.so
tag: ${{ github.ref }}
overwrite: true