forked from Qv2ray/QvPlugin-Trojan
-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (152 loc) · 6.81 KB
/
build-simpleplugin.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
name: QvTrojanPlugin Build Action - cmake
on:
push:
release:
types: [prereleased]
jobs:
build:
strategy:
matrix:
qt_version: [5.11.3]
platform: [ubuntu-16.04, macos-latest, windows-latest]
arch: [x86, x64]
include:
- platform: windows-latest
arch: x86
qtarch: win32_msvc2015
cmakearch: Win32
- platform: windows-latest
arch: x64
qtarch: win64_msvc2015_64
cmakearch: x64
exclude:
- platform: ubuntu-16.04
arch: x86
- platform: macos-latest
arch: x86
fail-fast: false
runs-on: ${{ matrix.platform }}
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::QvTrojanPlugin
- name: Checking out sources
uses: actions/checkout@master
- name: Install Python 3.7 version
uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: ${{ matrix.arch }}
- name: Restoring submodules
run: git submodule update --init
# =========================================================================================================
- name: Install Packages
if: matrix.platform == 'macos-latest'
run: |
brew install boost [email protected] zlib
- name: Install MSVC compiler
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
arch: ${{ matrix.arch }}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: QtCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.qt_version }}-${{ matrix.qtarch }}
- name: Installing Qt - ${{ matrix.arch }}
uses: jurplel/[email protected]
with:
version: ${{ matrix.qt_version }}
arch: ${{ matrix.qtarch }}
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
# ========================================================================================================= 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: |
[[ ${{ matrix.arch }} == "x86" ]] && arg="--forcex86" || arg=""
choco install $arg openssl > openssl_installer.log
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmakearch }} -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON
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
cmake --build . --parallel $(sysctl -n hw.logicalcpu)
# --------------------------------------------------------
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
BOOST_ROOT: "/usr/local/share/boost/1.72.0"
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON
cmake --build . --parallel $(nproc)
# ========================================================================================================= Deployments
- name: Win-${{ matrix.arch }} - ${{ 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-${{ matrix.arch }}.qt${{ matrix.qt_version }}.dll
path: build/Release/${{ steps.get_name.outputs.NAME }}.dll
- name: Win-${{ matrix.arch }} - ${{ 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-${{ matrix.arch }}.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-${{ matrix.arch }}.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-${{ matrix.arch }}.so
tag: ${{ github.ref }}
overwrite: true
# --------------------------------------------------------
- name: Linux - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'ubuntu-16.04'
uses: actions/upload-artifact@master
with:
name: ${{ steps.get_name.outputs.NAME }}-${{ github.sha }}.linux-${{ matrix.arch }}.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-16.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-${{ matrix.arch }}.so
tag: ${{ github.ref }}
overwrite: true