-
Notifications
You must be signed in to change notification settings - Fork 299
90 lines (72 loc) · 3.14 KB
/
library_shared.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
name: Library builds (shared)
on:
push:
branches: [ 'master', 'main', 'develop', 'actions_shared' ]
tags: [ 'v*' ]
pull_request:
branches: [ 'master', 'main', 'develop' ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests packaging
- name: Extract CoolProp version from CMakeLists.txt
shell: bash
run: |
set -x
COOLPROP_VERSION=$(python dev/extract_version.py --cmake-only)
echo COOLPROP_VERSION=$COOLPROP_VERSION >> $GITHUB_ENV
- name: Configure CMake
run: cmake -B build -S . -DCMAKE_BUILD_TYPE:STRING=${{ env.BUILD_TYPE }} -DCOOLPROP_SHARED_LIBRARY:BOOL=ON
- name: Build
run: cmake --build build --target install -j $(nproc) --config ${{ env.BUILD_TYPE }}
# Create a special case for Windows since we also need 2 flavours of 32bit binaries
- name: Configure CMake for 32bit Windows stdcall
if: startsWith(matrix.os, 'windows')
run: cmake -B build_stdc -S . -DCMAKE_BUILD_TYPE:STRING=${{ env.BUILD_TYPE }} -DCOOLPROP_SHARED_LIBRARY:BOOL=ON -DCOOLPROP_STDCALL_LIBRARY:BOOL=ON -A Win32
- name: Build with CMake for 32bit Windows stdcall
if: startsWith(matrix.os, 'windows')
run: cmake --build build_stdc --target install -j $(nproc) --config ${{ env.BUILD_TYPE }}
- name: Configure CMake for 32bit Windows cdecl
if: startsWith(matrix.os, 'windows')
run: cmake -B build_cdecl -S . -DCMAKE_BUILD_TYPE:STRING=${{ env.BUILD_TYPE }} -DCOOLPROP_SHARED_LIBRARY:BOOL=ON -DCOOLPROP_CDECL_LIBRARY:BOOL=ON -A Win32
- name: Build with CMake for 32bit Windows cdecl
if: startsWith(matrix.os, 'windows')
run: cmake --build build_cdecl --target install -j $(nproc) --config ${{ env.BUILD_TYPE }}
# - name: Tar.gz the shared library to maintain case sensitivy and file permissions
# working-directory: ./install_root/shared_library/
# shell: bash
# run: |
# set -x
# tar -cvzf CoolProp-${{ env.COOLPROP_VERSION }}-shared-${{ matrix.os }}.tar.gz ./*
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: shared_library
path: install_root/shared_library
# - name: Upload TGZ or ZIP to release
# if: contains(github.ref, 'refs/tags')
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: install_root/shared_library/CoolProp-${{ env.COOLPROP_VERSION }}-shared-${{ matrix.os }}.tar.gz
# tag: ${{ github.ref }}
# overwrite: true
# file_glob: false