-
Notifications
You must be signed in to change notification settings - Fork 1.2k
77 lines (66 loc) · 2.1 KB
/
cmake.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
name: CI for general build
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, ubuntu-20.04, windows-latest, macOS-11 ]
arch: [ x64 ]
include:
- os: windows-latest
arch: x86
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: ${{matrix.arch}}
- name: Config for Windows
if: runner.os == 'Windows'
run: |
if ("${{matrix.arch}}" -eq "x64") {
$msbuildPlatform = "x64"
} else {
$msbuildPlatform = "Win32"
}
cmake -A $msbuildPlatform -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root
- name: Config for Unix
if: runner.os != 'Windows'
run: cmake -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release --target install --parallel 8
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Release --output-on-failure
- name: Package
working-directory: ${{github.workspace}}/build
run: cpack
- name: Build Python wrapper
working-directory: ${{github.workspace}}/python
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py test
python setup.py bdist_wheel
- name: Upload artifcacts
uses: actions/upload-artifact@v3
with:
path: ./build/*.7z
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/*.7z
tag: ${{ github.ref }}
overwrite: true
prerelease: true
file_glob: true
body: "This is my release text"