-
Notifications
You must be signed in to change notification settings - Fork 20
118 lines (113 loc) · 3.72 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
# GitHub build workflow configuration file.
#
# This files defines the GitHub build actions which perform the following steps:
#
# - Building svOneDSolver on all supported platforms
# - Creating installers for all supported platforms
# - Uploading the generated installers as artifacts
# - Uploading the generated installers as release assets (only for releases)
name: Build
on: [push, pull_request]
jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
shell: bash
run: |
export TERM=xterm-256color
export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
mkdir Build
cd Build
cmake .. -DBUILD_SV_INSTALLER=ON
make -j3
- name: Create installer
shell: bash
run: |
cd Build
cpack
cp oneD*.pkg ../svOneDSolver-macOS.pkg
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: macOS Installer
path: svOneDSolver-macOS.pkg
if-no-files-found: error
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: svOneDSolver-macOS.pkg
asset_name: svOneDSolver-${{github.ref_name}}-macOS.pkg
tag: ${{ github.ref }}
build-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
shell: bash
run: sudo apt-get install gcc g++
- name: Build
shell: bash
run: |
mkdir Build
cd Build
cmake .. -DBUILD_SV_INSTALLER=ON
make -j2
- name: Create installer
shell: bash
run: |
cd Build
cpack
cp oneD*.deb ../svOneDSolver-Ubuntu.deb
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Ubuntu Installer
path: svOneDSolver-Ubuntu.deb
if-no-files-found: error
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: svOneDSolver-Ubuntu.deb
asset_name: svOneDSolver-${{github.ref_name}}-Ubuntu.deb
tag: ${{ github.ref }}
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Cygwin
uses: cygwin/cygwin-install-action@master
with:
install-dir: C:\cygwin64
packages: make tcl zip gzip tar patch wget
- name: Install Visual Studio BuildTools
run: |
choco install visualstudio2017buildtools visualstudio2017-workload-vctools
- name: Build
run: |
cd BuildWithMake
dos2unix ./windows-build.sh
C:\cygwin64\bin\bash.exe -c "./build_windows_github.bat"
cp Release/sim*.msi ../svOneDSolver-Windows.msi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Windows Installer
path: svOneDSolver-Windows.msi
if-no-files-found: error
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: svOneDSolver-Windows.msi
asset_name: svOneDSolver-${{github.ref_name}}-Windows.msi
tag: ${{ github.ref }}