forked from SAP-archive/fedem-solvers
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from openfedem/fmu-deployment
Build and deploy Fedem FMU libraries for Linux and Windows platforms
- Loading branch information
Showing
12 changed files
with
413 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This file is part of FEDEM - https://openfedem.org | ||
|
||
# The following line will ensure the auto-generated tar-balls that | ||
# github creates when makeing a new Release is empty. | ||
|
||
* export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This file is part of FEDEM - https://openfedem.org | ||
|
||
name: Build and release fedem FMU | ||
|
||
on: | ||
push: | ||
tags: | ||
- fmu-* | ||
|
||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-linux: | ||
name: Build FMU for Linux | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Configure the build | ||
run: cmake -S ./FMU -B ./build -DCMAKE_BUILD_TYPE=Release | ||
|
||
- name: Build FMU library | ||
run: cmake --build ./build --target fedem_fmu | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: fmu-linux | ||
path: build/src/libfedem_fmu.so | ||
|
||
build-win: | ||
name: Build FMU for Windows | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Configure the build | ||
run: cmake -S ./FMU -B ./build -G "Visual Studio 17 2022" | ||
|
||
- name: Build FMU library | ||
run: cmake --build ./build --config Release --target fedem_fmu | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: fmu-win | ||
path: build\src\Release\fedem_fmu.dll | ||
|
||
release-fmu: | ||
name: Release FMU package | ||
|
||
needs: [ build-linux, build-win ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.ACCESS_PAT }} | ||
|
||
- name: Get latest release tag | ||
run: | | ||
git checkout `git tag | grep fmu- tail -1` | ||
echo "MY_TAG=`git tag | grep fmu- tail -1`" >> $GITHUB_ENV | ||
echo "MY_VER=`cat cfg/VERSION`" >> $GITHUB_ENV | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
|
||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.MY_TAG }} | ||
name: "Fedem FMU ${{ env.MY_VER }}" | ||
token: ${{ secrets.ACCESS_PAT }} | ||
artifacts: "fmu-linux/libfedem_fmu.so,fmu-win/fedem_fmu.dll" | ||
body: "FMU libraries for the FEDEM dynamics solver" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This file is part of FEDEM - https://openfedem.org | ||
|
||
name: Build and release fedem solvers | ||
|
||
on: | ||
push: | ||
tags: | ||
- fedem-* | ||
|
||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish-solvers: | ||
name: Publish solver packages | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
token: ${{ secrets.ACCESS_PAT }} | ||
|
||
- name: Checkout the latest release tag | ||
run: | | ||
git checkout `git tag | grep fedem- | tail -1` | ||
echo "MY_TAG=`git tag | grep fedem- | tail -1`" >> $GITHUB_ENV | ||
echo "MY_VER=`cat cfg/VERSION`" >> $GITHUB_ENV | ||
- name: Configure main build | ||
run: > | ||
cmake -B ./build -DCMAKE_BUILD_TYPE=Release | ||
-DBUILD_TESTS=OFF | ||
-DBUILD_SOLVER_AS_DLL=ON | ||
-DBUILD_CONTROL_AS_DLL=ON | ||
-DUSE_CONCURRENT_RECOVERY=ON | ||
-DUSE_SP_RECOVERY=ON | ||
-DUSE_FFTPACK=ON | ||
- name: Build binaries | ||
run: cmake --build ./build --target all_solvers | ||
|
||
- name: Prepare release package | ||
run: | | ||
mkdir bin | ||
find build/src -name '*.so' -exec cp -p {} bin/ \; | ||
find build/src -name 'fedem_*' -type f -exec cp -p {} bin/ \; | ||
tar cfvz fedem-solvers-${{ env.MY_VER }}_linux64.tar.gz bin | ||
sed "1 s/.*$/Solver package for Fedem &/" cfg/RELEASE | tr '\n' ' ' > body.md | ||
sed "1 s/^.*\./(build /;s/.*$/&) for Linux 64-bit (Ubuntu)/" cfg/VERSION >> body.md | ||
- name: Build the fedempy package | ||
run: | | ||
sed "1 s/.*$/fedempy package for Fedem &/" cfg/RELEASE | tr '\n' ' ' >> body.md | ||
sed "1 s/^.*\./(build /;s/.*$/& and later)/" cfg/VERSION >> body.md | ||
cd PythonAPI | ||
python -m setup sdist | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.MY_TAG }} | ||
name: "Fedem solvers ${{ env.MY_VER }}" | ||
token: ${{ secrets.ACCESS_PAT }} | ||
artifacts: "fedem-solvers-${{ env.MY_VER }}_linux64.tar.gz,PythonAPI/dist/fedempy-${{ env.MY_VER }}.tar.gz" | ||
bodyFile: "body.md" | ||
allowUpdates: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This file is part of FEDEM - https://openfedem.org | ||
|
||
################################################################################ | ||
# This is the top-level cmake project file for the Fedem FMU module. | ||
################################################################################ | ||
|
||
cmake_minimum_required ( VERSION 2.8...3.5 ) | ||
if ( POLICY CMP0076 ) | ||
cmake_policy ( SET CMP0076 NEW ) # convert relative target source path names | ||
endif ( POLICY CMP0076 ) | ||
|
||
# Project setup | ||
|
||
set ( APPLICATION_ID fedemFMU ) | ||
set ( DOMAIN_ID FEDEM ) | ||
set ( PACKAGE_ID SOLVERS ) | ||
|
||
project ( ${APPLICATION_ID} CXX ) | ||
message ( STATUS "Generating build project for ${PROJECT_SOURCE_DIR}" ) | ||
get_filename_component ( PARENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY ) | ||
|
||
find_path ( _MODULES FedemConfig.cmake | ||
PATHS $ENV{CMAKE_MODULES} | ||
"${PARENT_SOURCE_DIR}/fedem-foundation/cmake/Modules/" | ||
) | ||
if ( _MODULES ) | ||
message ( STATUS "NOTE : Using ${_MODULES}" ) | ||
list ( APPEND CMAKE_MODULE_PATH ${_MODULES} ) | ||
else ( _MODULES ) | ||
message ( STATUS "ERROR : Missing path to FedemConfig.cmake" ) | ||
message ( FATAL_ERROR "Set environment variable CMAKE_MODULES and try again" ) | ||
endif ( _MODULES ) | ||
unset ( _MODULES CACHE ) | ||
|
||
include ( FedemConfig ) | ||
|
||
add_subdirectory ( ../src/FMU "${CMAKE_CURRENT_BINARY_DIR}/src" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.5.2 | ||
3.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.