Skip to content

Features/removespicedependencies (#220) #112

Features/removespicedependencies (#220)

Features/removespicedependencies (#220) #112

Workflow file for this run

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 }}