Implementation of the Syrope model for polyester ropes in MoorDyn #486
Workflow file for this run
This file contains hidden or 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
| name: CMake | |
| on: | |
| push: | |
| branches: [ $default-branch, master ] | |
| pull_request: | |
| branches: | |
| - "**" | |
| permissions: write-all | |
| env: | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: Release | |
| jobs: | |
| create_release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| if: github.event_name == 'push' | |
| - name: moordyn_tag_name | |
| id: moordyn_tag_name | |
| shell: bash | |
| run: | | |
| major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| echo "moordyn_tag_name=v$major.$minor.$patch" >> $GITHUB_OUTPUT | |
| if: github.event_name == 'push' | |
| # - uses: dev-drprasad/delete-tag-and-release@v1.0.1 | |
| # continue-on-error: true | |
| # with: | |
| # delete_release: true | |
| # tag_name: "nightly" | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # if: github.event_name == 'push' | |
| - uses: rickstaa/action-create-tag@v1 | |
| id: create_tag | |
| with: | |
| tag: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}} | |
| message: "Latest release (${{steps.moordyn_tag_name.outputs.moordyn_tag_name}})" | |
| force_push_tag: true | |
| if: github.event_name == 'push' | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}} | |
| release_name: ${{steps.moordyn_tag_name.outputs.moordyn_tag_name}} | |
| draft: false | |
| prerelease: false | |
| if: github.event_name == 'push' | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| needs: [create_release] | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: moordyn_version | |
| id: moordyn_version | |
| shell: bash | |
| run: | | |
| major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'` | |
| echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT | |
| - name: Setup GCC Fortran (Linux) | |
| uses: awvwgk/setup-fortran@main | |
| id: setup-fortran | |
| with: | |
| compiler: gcc | |
| if: runner.os == 'Linux' | |
| - name: Setup NSIS (Windows) | |
| run: | | |
| iwr -useb get.scoop.sh -outfile 'install.ps1' | |
| .\install.ps1 -RunAsAdmin | |
| scoop update | |
| scoop bucket add extras | |
| scoop install nsis | |
| Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\scoop\shims\" | |
| if: runner.os == 'Windows' | |
| - name: Install Rust-bindgen (Linux) | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get -qq -y install bindgen | |
| if: runner.os == 'Linux' | |
| - name: Create install folder | |
| run: | | |
| mkdir -p ${{github.workspace}}/install | |
| - name: Configure CMake (Linux) | |
| 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=ON -DRUST_WRAPPER:BOOL=ON -DBUILD_TESTING=ON | |
| if: runner.os == 'Linux' | |
| - name: Configure CMake (MacOS) | |
| 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 -DBUILD_TESTING=ON | |
| if: runner.os == 'MacOS' | |
| - name: Configure CMake (Windows) | |
| 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 -DBUILD_TESTING=ON | |
| if: runner.os == 'Windows' | |
| - name: Build | |
| id: build | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| # We do a little hack here. We install the library so we perfectly know the | |
| # path. Then we set the environment variable to let the OS find the | |
| # libraries | |
| - name: Install | |
| run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| - name: Set $PATH (Windows) | |
| run: Add-Content $env:GITHUB_PATH "${{github.workspace}}\install\bin" | |
| if: runner.os == 'Windows' | |
| - name: Test | |
| working-directory: ${{github.workspace}}/build | |
| # We are just testing in Linux | |
| run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure | |
| - name: Create Installer | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| # Package the installer | |
| run: cpack -C ${{env.BUILD_TYPE}} | |
| - name: Upload Linux installer | |
| id: upload-linux-installer | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create_release.outputs.upload_url }} | |
| asset_path: ${{github.workspace}}/build/Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-Linux.sh | |
| asset_name: Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-Linux.sh | |
| asset_content_type: application/exe | |
| if: ${{ (github.event_name == 'push') && (runner.os == 'Linux') }} | |
| - name: Upload MacOS installer | |
| id: upload-macos-installer | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create_release.outputs.upload_url }} | |
| asset_path: ${{github.workspace}}/build/Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-Darwin.sh | |
| asset_name: Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-Darwin.sh | |
| asset_content_type: application/exe | |
| if: ${{ (github.event_name == 'push') && (runner.os == 'MacOS') }} | |
| - name: Upload Windows installer | |
| id: upload-windows-installer | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create_release.outputs.upload_url }} | |
| asset_path: ${{github.workspace}}/build/Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-win64.exe | |
| asset_name: Moordyn-${{steps.moordyn_version.outputs.moordyn_version}}-win64.exe | |
| asset_content_type: application/exe | |
| if: ${{ (github.event_name == 'push') && (runner.os == 'Windows') }} |