-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (94 loc) · 4.01 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
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
name: CMake
on: push
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
TAG: win64_vs2017
jobs:
build-dockcross:
runs-on: ubuntu-20.04
env:
arch: manylinux1-x64
strategy:
fail-fast: false
matrix:
arch: [manylinux1-x64,manylinux1-x86,manylinux2014-x64,manylinux2014-x86,manylinux2014-aarch64,windows-shared-x64-posix,linux-armv7-lts]
BUILD_TYPE: [Release,Debug]
steps:
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0 # for git-restore-mtime
- name: Setup dockcross
run: |
docker pull dockcross/${{ matrix.arch }}:latest
docker run --rm dockcross/${{ matrix.arch }}:latest > dockcross
chmod +x dockcross
- name: Build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
./dockcross cmake -B /work/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_INSTALL_PREFIX=/work/install
./dockcross cmake --build /work/build --target install --config ${{matrix.BUILD_TYPE}}
- run: ls ${{github.workspace}}/install
- name: Easy Zip Files
uses: vimtor/action-zip@v1.1
with:
files: install/
recursive: true
dest: mockups_${{matrix.arch}}_${{matrix.BUILD_TYPE}}.zip
- run: ls ${{github.workspace}}
- uses: actions/upload-artifact@v3.1.2
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: artifacts
path: ${{github.workspace}}/mockups_${{matrix.arch}}_${{matrix.BUILD_TYPE}}.zip
- name: Release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{github.workspace}}/mockups_${{matrix.arch}}_${{matrix.BUILD_TYPE}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-osx:
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
env:
arch: manylinux1-x64
strategy:
fail-fast: false
matrix:
image: [macos-11,macos-m1]
BUILD_TYPE: [Release,Debug]
steps:
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0 # for git-restore-mtime
- uses: casadi/action-setup-compiler@master
with:
cache-suffix: ''
target: ${{matrix.image == 'macos-m1' && 'arm64' || 'x86_64'}}
- name: Build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake -DCMAKE_OSX_SYSROOT=${{env.CONDA_BUILD_SYSROOT}} -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
cmake --build build --target install --config ${{matrix.BUILD_TYPE}}
- run: ls ${{github.workspace}}/install
- name: Easy Zip Files
uses: vimtor/action-zip@v1.1
with:
files: install/
recursive: true
dest: mockups_${{matrix.image}}_${{matrix.BUILD_TYPE}}.zip
- run: ls ${{github.workspace}}
- uses: actions/upload-artifact@v3.1.2
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: artifacts
path: ${{github.workspace}}/mockups_${{matrix.image}}_${{matrix.BUILD_TYPE}}.zip
- name: Release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{github.workspace}}/mockups_${{matrix.image}}_${{matrix.BUILD_TYPE}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}