-
Notifications
You must be signed in to change notification settings - Fork 1
164 lines (142 loc) · 6.93 KB
/
deployment.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
name: IO Astrodynamics C++ CD
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
create_release_artifact:
strategy:
matrix:
os: [ubuntu-latest,windows-latest]
name: Create artifact
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Get tag
id: tag
uses: devops-actions/[email protected]
with:
strip_v: false
- name: Configure CMake
# 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: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Tests (Linux)
working-directory: ${{github.workspace}}/build/IO.Astrodynamics.Tests
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ./IO.Astrodynamics.Tests
if: matrix.os == 'ubuntu-latest'
- name: Tests (Windows)
working-directory: ${{github.workspace}}\build\IO.Astrodynamics.Tests\Release
shell: cmd
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: IO.Astrodynamics.Tests.exe
if: matrix.os == 'windows-latest'
- name: Copy Headers and library (Linux)
run: |
mkdir -p Toolkit/Linux/Includes
find IO.Astrodynamics/ -type f -name "*.h" -exec cp {} Toolkit/Linux/Includes/ \;
find external-lib/includeLinux/ -type f -name "*.h" -exec cp {} Toolkit/Linux/Includes/ \;
cp -f build/IO.Astrodynamics/libIO.Astrodynamics.so Toolkit/Linux/
if: matrix.os == 'ubuntu-latest'
- name: Copy Headers and library (Windows)
run: |
mkdir -p Toolkit\Windows\Includes
Get-ChildItem IO.Astrodynamics -recurse -force -filter "*.h" | Copy-Item -Destination Toolkit\Windows\Includes\
Get-ChildItem external-lib/includeWindows -recurse -force -filter "*.h" | Copy-Item -Destination Toolkit\Windows\Includes\
Copy-Item .\build\IO.Astrodynamics\Release\IO.Astrodynamics.dll Toolkit\Windows\
Copy-Item .\build\IO.Astrodynamics\Release\IO.Astrodynamics.lib Toolkit\Windows\
if: matrix.os == 'windows-latest'
- name: Copy solar system data (Linux)
run: |
mkdir -p Toolkit/Linux/Data/SolarSystem
find build/IO.Astrodynamics.Tests/Data/SolarSystem/ -type f -name "*.*" -exec cp {} Toolkit/Linux/Data/SolarSystem \;
zip -r IO-Toolkit-Linux-${{steps.tag.outputs.tag}}.zip Toolkit/Linux
if: matrix.os == 'ubuntu-latest'
- name: Copy solar system data (Windows)
run: |
mkdir -p Toolkit\Windows\Data\SolarSystem
Copy-Item -Path "IO.Astrodynamics.Tests\Data\Windows\*" -Destination "Toolkit\Windows" -recurse -Force
Compress-Archive -Path Toolkit\Windows\* -DestinationPath IO-Toolkit-Windows-${{steps.tag.outputs.tag}}.zip -Force
if: matrix.os == 'windows-latest'
- name: Release (Linux)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'ubuntu-latest'
with:
files: IO-Toolkit-Linux-${{steps.tag.outputs.tag}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release (Windows)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest'
with:
files: IO-Toolkit-Windows-${{steps.tag.outputs.tag}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create_debug_artifact:
strategy:
matrix:
os: [windows-latest]
name: Create debug artifact
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Get tag
id: tag
uses: devops-actions/[email protected]
with:
strip_v: false
- name: Configure CMake
# 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: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config Debug
- name: Tests (Windows)
working-directory: ${{github.workspace}}\build\IO.Astrodynamics.Tests\Debug
shell: cmd
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: IO.Astrodynamics.Tests.exe
if: matrix.os == 'windows-latest'
- name: Copy Headers and library (Windows)
run: |
mkdir -p Toolkit\Windows\Includes
Get-ChildItem IO.Astrodynamics -recurse -force -filter "*.h" | Copy-Item -Destination Toolkit\Windows\Includes\
Get-ChildItem external-lib/includeWindows -recurse -force -filter "*.h" | Copy-Item -Destination Toolkit\Windows\Includes\
Copy-Item .\build\IO.Astrodynamics\Debug\IO.Astrodynamics.dll Toolkit\Windows\
Copy-Item .\build\IO.Astrodynamics\Debug\IO.Astrodynamics.lib Toolkit\Windows\
Copy-Item .\build\IO.Astrodynamics\Debug\IO.Astrodynamics.exp Toolkit\Windows\
Copy-Item .\build\IO.Astrodynamics\Debug\IO.Astrodynamics.pdb Toolkit\Windows\
if: matrix.os == 'windows-latest'
- name: Copy solar system data (Windows)
run: |
mkdir -p Toolkit\Windows\Data\SolarSystem
Copy-Item -Path "IO.Astrodynamics.Tests\Data\Windows\*" -Destination "Toolkit\Windows" -recurse -Force
Compress-Archive -Path Toolkit\Windows\* -DestinationPath IO-Toolkit-Windows-${{steps.tag.outputs.tag}}-Debug.zip -Force
if: matrix.os == 'windows-latest'
- name: Release (Windows)
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest'
with:
files: IO-Toolkit-Windows-${{steps.tag.outputs.tag}}-Debug.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}