Skip to content

Commit ff2888f

Browse files
authored
Merge pull request #137 from FloatingArrayDesign/dev
Version 2.2.1
2 parents 65166bc + 55667f4 commit ff2888f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3173
-2202
lines changed

.github/workflows/build-mingw.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: CMake
1+
name: MinGW
22

33
on:
44
push:
5-
branches: [ $default-branch, master, v2 ]
5+
branches: [ $default-branch, master ]
66
pull_request:
77
branches:
88
- "**"
@@ -21,7 +21,7 @@ jobs:
2121
os: [windows-latest]
2222

2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

2626
- name: Create folders
2727
run: |
@@ -32,5 +32,4 @@ jobs:
3232
run: cmake -B ${{github.workspace}}/build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=OFF -DBUILD_TESTING=ON
3333

3434
- name: Build
35-
id: build
3635
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

.github/workflows/build-test.yml

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CMake
22

33
on:
44
push:
5-
branches: [ $default-branch, master, v2 ]
5+
branches: [ $default-branch, master ]
66
pull_request:
77
branches:
88
- "**"
@@ -24,23 +24,33 @@ jobs:
2424
release_id: ${{ steps.create_release.outputs.id }}
2525
upload_url: ${{ steps.create_release.outputs.upload_url }}
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
if: github.event_name == 'push'
2929

30-
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
31-
continue-on-error: true
32-
with:
33-
delete_release: true
34-
tag_name: "nightly"
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
- name: moordyn_tag_name
31+
id: moordyn_tag_name
32+
shell: bash
33+
run: |
34+
major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
35+
minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
36+
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
37+
echo "moordyn_tag_name=v$major.$minor.$patch" >> $GITHUB_OUTPUT
3738
if: github.event_name == 'push'
3839

40+
# - uses: dev-drprasad/delete-tag-and-release@v1.0.1
41+
# continue-on-error: true
42+
# with:
43+
# delete_release: true
44+
# tag_name: "nightly"
45+
# env:
46+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
# if: github.event_name == 'push'
48+
3949
- uses: rickstaa/action-create-tag@v1
4050
id: create_tag
4151
with:
42-
tag: "nightly"
43-
message: "Latest release"
52+
tag: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
53+
message: "Latest release (${{steps.moordyn_tag_name.outputs.moordyn_tag_name}})"
4454
force_push_tag: true
4555
if: github.event_name == 'push'
4656

@@ -50,8 +60,8 @@ jobs:
5060
env:
5161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5262
with:
53-
tag_name: "nightly"
54-
release_name: "nightly"
63+
tag_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
64+
release_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}}
5565
draft: false
5666
prerelease: false
5767
if: github.event_name == 'push'
@@ -64,7 +74,7 @@ jobs:
6474
os: [ubuntu-22.04, windows-latest, macOS-latest]
6575

6676
steps:
67-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@v4
6878

6979
- name: moordyn_version
7080
id: moordyn_version
@@ -75,19 +85,15 @@ jobs:
7585
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
7686
echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT
7787
78-
- name: Setup GCC Fortran (Linux & Mac)
88+
- name: Setup GCC Fortran (Linux)
7989
uses: awvwgk/setup-fortran@main
8090
id: setup-fortran
8191
with:
8292
compiler: gcc
8393
if: runner.os == 'Linux'
8494

85-
- name: Setup Intel Fortran
86-
uses: modflowpy/install-intelfortran-action@v1
87-
if: runner.os == 'Windows'
88-
8995
- name: download pre-built VTK static library
90-
uses: suisei-cn/actions-download-file@v1.0.1
96+
uses: suisei-cn/actions-download-file@v1.4.0
9197
with:
9298
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
9399
target: ${{github.workspace}}/
@@ -106,22 +112,32 @@ jobs:
106112
if: runner.os == 'Linux'
107113

108114
- name: Configure CMake (Windows)
109-
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=OFF
115+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=ON
110116
if: runner.os == 'Windows'
111117

112118
- name: Configure CMake (Mac)
113-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=OFF
119+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DBUILD_TESTING=ON
114120
if: runner.os == 'macOS'
115121

116122
- name: Build
117123
id: build
118124
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
119125

120-
- name: Test (Linux)
126+
# We do a little hack here. We install the library so we perfectly know the
127+
# path. Then we set the environment variable to let the OS find the
128+
# libraries
129+
130+
- name: Install
131+
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
132+
133+
- name: Set $PATH (Windows)
134+
run: Add-Content $env:GITHUB_PATH "${{github.workspace}}\install\bin"
135+
if: runner.os == 'Windows'
136+
137+
- name: Test
121138
working-directory: ${{github.workspace}}/build
122139
# We are just testing in Linux
123140
run: ctest -C ${{env.BUILD_TYPE}}
124-
if: runner.os == 'Linux'
125141

126142
- name: Install
127143
working-directory: ${{github.workspace}}/build
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check version
2+
3+
on:
4+
pull_request:
5+
branches: [ $default-branch, master ]
6+
7+
jobs:
8+
check:
9+
name: Check that the version is valid
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: moordyn_version
15+
id: moordyn_version
16+
shell: bash
17+
run: |
18+
major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
19+
minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
20+
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
21+
echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT
22+
23+
- name: Tag check
24+
uses: mukunku/tag-exists-action@v1.4.0
25+
id: checkTag
26+
with:
27+
tag: "v${{steps.moordyn_version.outputs.moordyn_version}}"
28+
29+
- name: Stop if tag exists
30+
run: |
31+
if [ ${{ steps.checkTag.outputs.exists }} == true ]; then exit 1; else exit 0; fi

.github/workflows/python-wheels.yml

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Python-Wheels
22

33
on:
44
push:
5-
branches: [ $default-branch, master, v2-make-wheels ]
5+
branches: [ $default-branch, master ]
66

77
permissions: write-all
88

@@ -29,10 +29,12 @@ jobs:
2929
tar -xvzf vtk-Linux-`uname -m`.tar.gz -C vtk/
3030
3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333

3434
# Used to host cibuildwheel
35-
- uses: actions/setup-python@v3
35+
- uses: actions/setup-python@v4
36+
with:
37+
python-version: '3.x'
3638

3739
- name: Create setup.py
3840
run: |
@@ -47,42 +49,42 @@ jobs:
4749
run: python -m pip install cibuildwheel
4850

4951
- name: download pre-built VTK static library (non-Linux)
50-
uses: suisei-cn/actions-download-file@v1.0.1
52+
uses: suisei-cn/actions-download-file@v1.4.0
5153
with:
5254
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
5355
target: ${{github.workspace}}/
5456
if: runner.os != 'Linux'
5557

5658
- name: download pre-built VTK static library (Linux-x86_64)
57-
uses: suisei-cn/actions-download-file@v1.0.1
59+
uses: suisei-cn/actions-download-file@v1.4.0
5860
with:
5961
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz
6062
target: ${{github.workspace}}/
6163
if: runner.os == 'Linux'
6264

6365
- name: download pre-built VTK static library (Linux-aarch64)
64-
uses: suisei-cn/actions-download-file@v1.0.1
66+
uses: suisei-cn/actions-download-file@v1.4.0
6567
with:
6668
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-aarch64.tar.gz
6769
target: ${{github.workspace}}/
6870
if: runner.os == 'Linux'
6971

7072
- name: download pre-built VTK static library (Linux-armv7)
71-
uses: suisei-cn/actions-download-file@v1.0.1
73+
uses: suisei-cn/actions-download-file@v1.4.0
7274
with:
7375
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-armv7.tar.gz
7476
target: ${{github.workspace}}/
7577
if: runner.os == 'Linux'
7678

7779
- name: download pre-built VTK static library (Linux-ppc64le)
78-
uses: suisei-cn/actions-download-file@v1.0.1
80+
uses: suisei-cn/actions-download-file@v1.4.0
7981
with:
8082
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-ppc64le.tar.gz
8183
target: ${{github.workspace}}/
8284
if: runner.os == 'Linux'
8385

8486
- name: download pre-built VTK static library (Linux-s390x)
85-
uses: suisei-cn/actions-download-file@v1.0.1
87+
uses: suisei-cn/actions-download-file@v1.4.0
8688
with:
8789
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-s390x.tar.gz
8890
target: ${{github.workspace}}/
@@ -98,10 +100,40 @@ jobs:
98100
tar -xvzf vtk-${{runner.os}}-x86_64.tar.gz -C vtk/
99101
if: runner.os != 'Linux'
100102

103+
- name: Build the source distribution
104+
run: python setup.py sdist
105+
if: runner.os == 'Linux'
106+
101107
- name: Build wheels
102-
run: python -m cibuildwheel --output-dir wheelhouse
108+
run: python -m cibuildwheel --output-dir dist
103109

104110
- uses: actions/upload-artifact@v3
111+
id: build_wheels
112+
with:
113+
name: python-package-distributions
114+
path: ./dist/*
115+
116+
publish:
117+
runs-on: ${{ matrix.os }}
118+
needs: [build_wheels]
119+
strategy:
120+
matrix:
121+
os: [ubuntu-22.04]
122+
123+
steps:
124+
- uses: actions/checkout@v4
125+
126+
- name: Download all the dists
127+
uses: actions/download-artifact@v3
128+
with:
129+
name: python-package-distributions
130+
path: dist/
131+
132+
- name: Publish package to TestPyPI
133+
uses: pypa/gh-action-pypi-publish@release/v1
105134
with:
106-
name: "Python wheels"
107-
path: ./wheelhouse/*.whl
135+
# password: ${{ secrets.MOORDYN_TESTPYPI_API }}
136+
# repository-url: https://test.pypi.org/legacy/
137+
password: ${{ secrets.MOORDYN_PYPI_API }}
138+
repository-url: https://upload.pypi.org/legacy/
139+
skip-existing: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ dist
6565

6666
/source/.vscode
6767
.vscode/*
68+
docs/_build/*

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
version: 2
3+
4+
build:
5+
os: ubuntu-22.04
6+
tools:
7+
python: "3.11"
8+
apt_packages:
9+
- graphviz
10+
11+
sphinx:
12+
configuration: docs/conf.py
13+
14+
python:
15+
install:
16+
- requirements: docs/requirements.txt

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.10)
22
set(MOORDYN_MAJOR_VERSION 2)
33
set(MOORDYN_MINOR_VERSION 2)
4-
set(MOORDYN_PATCH_VERSION 0)
4+
set(MOORDYN_PATCH_VERSION 1)
55
set(MOORDYN_VERSION ${MOORDYN_MAJOR_VERSION}.${MOORDYN_MINOR_VERSION})
66
project(Moordyn VERSION ${MOORDYN_VERSION})
77

@@ -21,7 +21,7 @@ set(BUILD_DOCS OFF CACHE BOOL
2121
"Build the documentation for users and developers")
2222
set(BUILD_BENCHMARKS OFF CACHE BOOL
2323
"Build the benchmarks. Makes use of Google's Benchmark library and requires an internet connection to download.")
24-
set(EXTERNAL_EIGEN ON CACHE BOOL
24+
set(EXTERNAL_EIGEN OFF CACHE BOOL
2525
"Use the Eigen3 installed in the system")
2626
set(USE_VTK OFF CACHE BOOL
2727
"Link with VTK to produce output binary files")

0 commit comments

Comments
 (0)