-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (91 loc) · 3.15 KB
/
build-and-release.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
name: Build and Release PlatypusGui
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build and Upload Artifacts
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
# 1. Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
- name: Get Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: run-vcpkg
uses: lukka/run-vcpkg@v11.5
# 2. Set up the environment
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: '3.16'
- name: Install Qt
uses: jurplel/install-qt-action@v4
# Install vcpkg
- name: Install vcpkg
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
# Install OpenCV via vcpkg
- name: Install OpenCV via vcpkg
if: matrix.os == 'windows-latest'
run: |
.\vcpkg\vcpkg.exe install opencv[contrib]:x64-windows
# Set up MSVC environment
- name: Set up MSVC environment
if: matrix.os == 'windows-latest'
shell: cmd
run: |
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set InstallDir=%%i
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" x64
# Configure CMake (Windows)
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
cmake -B build -S . -G Ninja ^
-DCMAKE_TOOLCHAIN_FILE=%cd%\vcpkg\scripts\buildsystems\vcpkg.cmake ^
-DCMAKE_BUILD_TYPE=Release
# Linux setup
- name: Install dependencies on Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libopencv-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libxcb1-dev
# macOS setup
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew install qt@5 opencv libxcb
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
# 3. Configure CMake
- name: Configure CMake
if : matrix.os != 'windows-latest'
run: cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release
# 4. Build the project
- name: Build PlatypusGui
run: cmake --build build --config Release --target PlatypusGui
# 5. Archive the build output3
- name: Archive build output
if: matrix.os == 'ubuntu-latest'
run: zip -r PlatypusGui-linux.zip build/PlatypusGui
- name: Archive build output
if: matrix.os == 'macos-latest'
run: zip -r PlatypusGui-mac.zip build/PlatypusGui
- name: Archive build output
if: matrix.os == 'windows-latest'
run: Compress-Archive -Path build\Release\PlatypusGui.exe -DestinationPath PlatypusGui-windows.zip
# 6. Upload artifacts for release
- name: Upload Release Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-platypus
path: |
PlatypusGui-linux.zip
PlatypusGui-mac.zip
PlatypusGui-windows.zip