Install kadas libraries #773
Workflow file for this run
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
--- | |
name: π Build - MacOS | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
release: | |
types: ['published'] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
# - os: macos-13 | |
# triplet: x64-osx | |
# deployment-target: "10.15" | |
- os: macos-14 | |
triplet: arm64-osx-dynamic | |
deployment-target: "11.0" | |
name: build (macos) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π£ Checkout | |
uses: actions/checkout@v4 | |
- name: π© Install CMake and Ninja | |
uses: lukka/get-cmake@latest | |
with: | |
# Pin to specific version to avoid rebuilding too often | |
# Also helps to avoid spurious build failures like https://github.com/qgis/QGIS/pull/47098 | |
cmakeVersion: 3.29.0 | |
- name: π¨ Prepare build env | |
run: | | |
brew install automake bison flex gnu-sed create-dmg autoconf-archive nasm libtool fdupes | |
echo $(brew --prefix bison)/bin >> $GITHUB_PATH | |
echo $(brew --prefix flex)/bin >> $GITHUB_PATH | |
echo $(brew --prefix libtool)/bin >> $GITHUB_PATH | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: π Setup XCode | |
uses: maxim-lobanov/setup-xcode@v1.6.0 | |
with: | |
xcode-version: latest-stable | |
- name: π± Install dependencies and generate project files | |
env: | |
GDAL_PYTHON_BINDINGS_WITHOUT_NUMPY: "Yes" | |
run: | | |
# Install first only with binarycaching, then deduplicate binaries and replace copies with symlinks. | |
# Nuget doesn't understand the symlink concept | |
cmake -S . \ | |
-G Ninja \ | |
-B build \ | |
-D WITH_QTWEBKIT=OFF \ | |
-D VCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \ | |
-D VCPKG_HOST_TRIPLET="${{ matrix.triplet }}" \ | |
-D VCPKG_INSTALL_OPTIONS="--only-binarycaching" \ | |
-D NUGET_USERNAME=kadas-albireo \ | |
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} || true | |
fdupes -r -1 build/vcpkg_installed/arm64-osx-dynamic/lib | grep libQt | while read line; do master=""; for file in ${line[*]}; do if [[ "x${master}" == "x" ]]; then master=$file; else rm "${file}"; ln -s $(basename "${master}") "${file}"; fi; done; done | |
cmake -D VCPKG_INSTALL_OPTIONS="" build | |
- name: π Upload vcpkg build logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: build-logs-${{ matrix.triplet }} | |
path: | | |
build/_deps/vcpkg-src/buildtrees/**/*.log | |
- name: π¦ Create SDK | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' | |
run: | | |
./build/_deps/vcpkg-src/vcpkg export --zip --output-dir=./sdk --x-install-root=./build/vcpkg_installed --x-manifest-root=vcpkg | |
- name: π€ Upload sdk | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kadas-albireo2-sdk-${{ matrix.triplet }} | |
path: | | |
sdk/vcpkg-export-*.zip | |
- name: Compile plugins translation | |
run: | | |
# lrelease is run from cmake for app | |
# plugins need to be handled | |
export PATH="${{ github.workspace }}/build/vcpkg_installed/${{ matrix.triplet }}/tools/qt5/bin:${PATH}" | |
for PLUGIN in about gpkg print; do | |
lrelease share/python/plugins/kadas_${PLUGIN}/kadas_${PLUGIN}_ts.pro | |
done | |
- name: π Build | |
run: | | |
cmake --build build |