-
Notifications
You must be signed in to change notification settings - Fork 3
184 lines (158 loc) · 5.38 KB
/
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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: CI
on:
push:
branches:
- '**'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- develop
jobs:
build-windows:
runs-on: windows-2022
timeout-minutes: 30
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
with:
path: virtualbow
- name: Get dependencies
run: |
choco install ninja
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/windows-mingw_64.zip && 7z x windows-mingw_64.zip
- name: Build and test solver
run: |
cd virtualbow/solver
cargo test --release
- name: Build and test application
run: |
mkdir build && cd build
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../windows-mingw_64/paths.cmake
cmake --build . -j4
cmake --build . --target iss-installer -j4
- uses: actions/upload-artifact@v4
with:
name: windows-application
path: build/application
- uses: actions/upload-artifact@v4
with:
name: windows-packages
path: build/packages
build-linux:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
path: virtualbow
- name: Get dependencies
run: |
sudo apt install -y ninja-build qt5-default
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/linux-gcc_64.zip && unzip linux-gcc_64.zip
- name: Build and test solver
run: |
cd virtualbow/solver
cargo test --release
- name: Build and test application
run: |
mkdir build && cd build
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../linux-gcc_64/paths.cmake
cmake --build . -j4
cmake --build . --target deb-package -j4
cmake --build . --target rpm-package -j4
- uses: actions/upload-artifact@v4
with:
name: linux-application
path: build/application
- uses: actions/upload-artifact@v4
with:
name: linux-packages
path: build/packages
build-macos:
runs-on: macos-12
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
path: virtualbow
- name: Get dependencies
run: |
brew install ninja
npm install -g appdmg@0.6.0 --no-audit
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/macos-clang_64.zip && unzip macos-clang_64.zip
chmod -R 755 macos-clang_64
- name: Build and test solver
run: |
cd virtualbow/solver
cargo test --release
- name: Build and test application
run: |
mkdir build && cd build
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../macos-clang_64/paths.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
cmake --build . -j4
cmake --build . --target dmg-installer -j4
- uses: actions/upload-artifact@v4
with:
name: macos-application
path: build/application
- uses: actions/upload-artifact@v4
with:
name: macos-packages
path: build/packages
develop-release:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-20.04
needs: [build-windows, build-linux, build-macos]
steps:
- uses: actions/download-artifact@v4
with:
name: windows-packages
- uses: actions/download-artifact@v4
with:
name: linux-packages
- uses: actions/download-artifact@v4
with:
name: macos-packages
- name: Rename packages
run: |
mv virtualbow-setup.exe virtualbow-${GITHUB_SHA::7}-win64.exe
mv virtualbow.deb virtualbow-${GITHUB_SHA::7}-linux64.deb
mv virtualbow.rpm virtualbow-${GITHUB_SHA::7}-linux64.rpm
mv virtualbow.dmg virtualbow-${GITHUB_SHA::7}-mac64.dmg
- name: Create release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Development Build
files: virtualbow*
tagged-release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-20.04
needs: [build-windows, build-linux, build-macos]
steps:
- uses: actions/download-artifact@v4
with:
name: windows-packages
- uses: actions/download-artifact@v4
with:
name: linux-packages
- uses: actions/download-artifact@v4
with:
name: macos-packages
- name: Rename packages
run: |
mv virtualbow-setup.exe virtualbow-${{github.ref_name}}-win64.exe
mv virtualbow.deb virtualbow-${{github.ref_name}}-linux64.deb
mv virtualbow.rpm virtualbow-${{github.ref_name}}-linux64.rpm
mv virtualbow.dmg virtualbow-${{github.ref_name}}-mac64.dmg
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
draft: true
files: virtualbow*