remove relocatiblity fix that should no longer be necessary #439
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: CI | |
| # builds and (manually) releases the contrib for mac, linux and windows | |
| # note: prepare job is run first to determine a tag that can be used by all OS runners | |
| on: | |
| push: | |
| workflow_dispatch: # This allows you to manually trigger the workflow from the GitHub UI | |
| jobs: | |
| prepare: # separate job to generate tag name exactly once based on the date | |
| runs-on: ubuntu-latest | |
| outputs: | |
| TAG_NAME: ${{ steps.generate_tag_name.outputs.TAG_NAME }} # map step output to job output | |
| steps: | |
| - name: Generate tag name | |
| id: generate_tag_name | |
| run: echo "TAG_NAME=$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT | |
| build: | |
| needs: prepare | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| CMAKE_ARGS: "" | |
| - os: macos-latest | |
| CMAKE_ARGS: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 | |
| - os: windows-latest | |
| CMAKE_ARGS: -G"Visual Studio 17 2022" -A"x64" | |
| - os: ubuntu-24.04-arm | |
| CMAKE_ARGS: "" | |
| steps: | |
| - name: Transfer variable TAG_NAME between jobs to be available as step output in this job | |
| id: generate_tag_name | |
| run: echo "TAG_NAME=${{needs.prepare.outputs.TAG_NAME}}" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: contrib | |
| - name: Setup cmake | |
| if: ${{ !endsWith(matrix.os, '-arm') }} | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '3.29.x' | |
| - name: Install CMake (Ubuntu arm64) | |
| if: ${{ endsWith(matrix.os, '-arm') }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake | |
| - name: Install prerequisites | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get -y install make autoconf automake tar patch libtool gcc libthrift-dev | |
| elif [ "$RUNNER_OS" == "Windows" ]; then | |
| # choco install important_windows_software | |
| echo "Nothing to install" | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| brew install autoconf automake libtool thrift | |
| else | |
| echo "$RUNNER_OS not supported" | |
| exit 1 | |
| fi | |
| # Normalize path to only contain front slashes | |
| - name: Normalize path on windows | |
| if: startsWith(matrix.os, 'windows') | |
| id: normalize_ws | |
| run: | | |
| $normalizedWorkspace = $env:GITHUB_WORKSPACE -replace '\\', '/' | |
| Write-Output "NORMALIZED_WORKSPACE=$normalizedWorkspace" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - name: Set up Visual Studio shell | |
| uses: egor-tensin/vs-shell@v2 | |
| with: | |
| arch: x64 | |
| - name: Build contrib (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| $NPROC = $env:NUMBER_OF_PROCESSORS | |
| if (-not $NPROC) { $NPROC = 4 } | |
| $env:CMAKE_BUILD_PARALLEL_LEVEL = $NPROC | |
| New-Item -ItemType Directory -Force -Path "${{ github.workspace }}\contrib-build" | |
| Set-Location "${{ github.workspace }}\contrib-build" | |
| cmake ${{ matrix.CMAKE_ARGS }} -DBUILD_TYPE=ALL "${{ github.workspace }}\contrib" | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| New-Item -ItemType Directory -Force -Path "${{ github.workspace }}\contrib-build-openmp" | |
| Set-Location "${{ github.workspace }}\contrib-build-openmp" | |
| cmake ${{ matrix.CMAKE_ARGS }} -DBUILD_TYPE=OPENMP "${{ github.workspace }}\contrib" | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Build contrib (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "macOS" ]; then | |
| NPROC=$(sysctl -n hw.ncpu 2>/dev/null) || NPROC=4 | |
| else | |
| NPROC=$(nproc 2>/dev/null) || NPROC=4 | |
| fi | |
| export CMAKE_BUILD_PARALLEL_LEVEL=${NPROC:-4} | |
| mkdir -p "$GITHUB_WORKSPACE/contrib-build" | |
| cd "$GITHUB_WORKSPACE/contrib-build" | |
| cmake ${{ matrix.CMAKE_ARGS }} -DBUILD_TYPE=ALL "$GITHUB_WORKSPACE/contrib" | |
| mkdir -p "$GITHUB_WORKSPACE/contrib-build-openmp" | |
| cd "$GITHUB_WORKSPACE/contrib-build-openmp" | |
| cmake ${{ matrix.CMAKE_ARGS }} -DBUILD_TYPE=OPENMP "$GITHUB_WORKSPACE/contrib" | |
| - name: Configure Git for Tagging | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'actions@github.com' | |
| - name: Create and Push Tag | |
| if: github.event_name == 'workflow_dispatch' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd "${{ github.workspace }}/contrib" | |
| git tag ${{ steps.generate_tag_name.outputs.TAG_NAME }} | |
| git push origin ${{ steps.generate_tag_name.outputs.TAG_NAME }} | |
| shell: bash | |
| - name: Clean build and package | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| cd "${{ github.workspace }}/contrib-build" | |
| rm -rf archives src CMakeFiles | |
| tar -czvf "contrib_build-${{ runner.os }}.tar.gz" $(ls -d lib) $(ls -d bin) $(ls -d include) $(ls -d share) | |
| shell: bash | |
| - name: Create Release (Windows) | |
| if: github.event_name == 'workflow_dispatch' && startsWith(matrix.os, 'windows') | |
| id: create_release_win | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.generate_tag_name.outputs.TAG_NAME }} | |
| files: | | |
| ${{ steps.normalize_ws.outputs.NORMALIZED_WORKSPACE }}/contrib-build/contrib_build-${{runner.os}}.tar.gz | |
| - name: Create Release (Mac and Linux) | |
| if: github.event_name == 'workflow_dispatch' && !startsWith(matrix.os, 'windows') | |
| id: create_release_mac_linux | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.generate_tag_name.outputs.TAG_NAME }} | |
| files: | | |
| ${{ github.workspace }}/contrib-build/contrib_build-${{runner.os}}.tar.gz |