Skip to content

Build Third-party libraries on Linux (static) #24

Build Third-party libraries on Linux (static)

Build Third-party libraries on Linux (static) #24

# This workflow builds third-party libraries for Ocean on Linux (static)
# Based on : https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build Third-party libraries on Linux (static)
on:
schedule:
# Execute this workflow:
# Mon-Sun, every 24 hours at 6 am (UTC)
- cron: '0 6 * * *'
# Have the ability to trigger this job manually through the API
workflow_dispatch:
env:
OCEAN_LINK_TYPE: static
OCEAN_THIRDPARTY_BUILD_PATH: ${{ github.workspace }}/ocean_thirdparty_build
OCEAN_THIRDPARTY_INSTALL_PATH: ${{ github.workspace }}/ocean_thirdparty_install
jobs:
build:
name: Linux (${{ matrix.build_config }}, static)
runs-on: ubuntu-latest
strategy:
matrix:
build_config: [debug, release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y -o Acquire::Retries=5 \
git ninja-build zip libx11-dev libgtk-3-dev \
liblzma-dev libgl1-mesa-dev libxcb-glx0-dev \
libdeflate-dev libudev-dev zlib1g-dev
# - name: Install a newer CMake
# run: |
# sudo apt purge --auto-remove cmake
# wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
# sudo apt-add-repository -y 'deb https://apt.kitware.com/ubuntu/ jammy main'
# sudo apt update
# sudo apt install -y cmake
- name: Build and install third-party libraries for Ocean
run: |
${{ github.workspace }}/build/cmake/build_thirdparty_linuxunix.sh \
-i ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }} \
-b ${{ env.OCEAN_THIRDPARTY_BUILD_PATH }} \
-c ${{ matrix.build_config }} \
-l ${{ env.OCEAN_LINK_TYPE }}
- name: Archive install artifacts
run: |
tar -cvzf thirdparty-install-${{ matrix.build_config }}.tar.gz ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }}
- name: Upload install archive (${{ matrix.build_config }})
uses: actions/upload-artifact@v4
with:
name: thirdparty-install-${{ matrix.build_config }}
path: ./thirdparty-install-${{ matrix.build_config }}.tar.gz
compression-level: 0