-
-
Notifications
You must be signed in to change notification settings - Fork 68
115 lines (100 loc) · 3.74 KB
/
mingw.yml
File metadata and controls
115 lines (100 loc) · 3.74 KB
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
# Author:Kang Lin <kl222@126.com>
name: build_mingw
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_mingw.outputs.name }}
jobs:
build_mingw:
name: build mingw
strategy:
matrix:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: [Release, Debug]
defaults:
run:
shell: cmd
# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: windows-latest
env:
SOURCE_DIR: ${{github.workspace}}\.cache\source
TOOLS_DIR: ${{github.workspace}}\.cache\tools
INSTALL_DIR: ${{github.workspace}}\.cache\install_mingw
SerialPortAssistant_VERSION: v0.5.33
artifact_name: build_mingw
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Make directories
run: |
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
cmake -E make_directory ${{github.workspace}}/build
- name: pacman
env:
PATH: C:\msys64\usr\bin
run: |
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm ^
mingw-w64-x86_64-cmake ^
mingw-w64-x86_64-make ^
mingw-w64-x86_64-nsis ^
mingw-w64-x86_64-gcc ^
mingw-w64-x86_64-qt6 ^
mingw-w64-x86_64-cmark ^
mingw-w64-x86_64-zlib ^
mingw-w64-x86_64-openssl ^
git base-devel
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: cache-installed-mingw
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: build SerialPortAssistant
working-directory: ${{github.workspace}}\build
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}\RabbitCommon
MSYSTEM: MINGW64
PATH: C:\msys64\mingw64\bin;C:\msys64\usr\bin
PKG_CONFIG_PATH: ${{env.INSTALL_DIR}}/lib/pkgconfig
run: |
cmake .. -G"MinGW Makefiles" ^
-DCMARK_SHARED=OFF ^
-DCMARK_TESTS=OFF ^
-DCMARK_STATIC=ON ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install ^
-DRABBIT_ENABLE_INSTALL_DEPENDENT=OFF ^
-DRABBIT_ENABLE_INSTALL_QT=OFF ^
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=OFF ^
-DBUILD_FREERDP=ON ^
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}
cmake --build . --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
copy /Y C:\msys64\mingw64\bin\*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\bin\*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\lib\*.dll install\bin
makensis ${{github.workspace}}\build\Install.nsi
- name: update artifact
if: false # ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}\build\SerialPortAssistant_Setup_${{env.SerialPortAssistant_VERSION}}.exe