Skip to content

GDAL 3.9.0

GDAL 3.9.0 #390

Workflow file for this run

name: MacOS Build
on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet/
DOTNET_VERSION: '8.0.x'
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-archives/
IS_PRE_RELEASE: ${{ !contains(github.ref, 'main') || contains(github.event.head_commit.message, '[prerelease]') }}
jobs:
BuildNugetPackages-MacOS:
strategy:
matrix:
os: [macos-14, macos-13]
include:
- os: macos-14
arch: arm64
- os: macos-13
arch: x64
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: osx
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: NuGet - set credentials
uses: ./.github/actions/set-credentials
with:
api-key-github: ${{ secrets.API_KEY_GITHUB }}
api-key-nuget: ${{ secrets.API_KEY_NUGET }}
api-user-github: ${{ secrets.API_USER_GITHUB }}
api-user-nuget: ${{ secrets.API_USER_NUGET }}
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.3.1.app/Contents/Developer'
- name: Restore cached packages
id: build-packages-cache-restore
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build-osx/
${{ github.workspace }}/.dotnet/
${{ github.workspace }}/vcpkg-archives/
key: ${{ runner.os }}-packages-${{ matrix.os }}
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install CMake
run: |
pipx install cmake
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install deps
run: |
${{ github.workspace }}/osx/before-install.sh
- name: Fetch VCPKG packages
run: |
mkdir -p ${{ github.workspace }}/vcpkg-archives/
make -f vcpkg-makefile BUILD_ARCH=${{ matrix.arch }} build_cleanup
make -f vcpkg-makefile BUILD_ARCH=${{ matrix.arch }}
- name: Compile HDF
run: |
make -f gdal-makefile hdf-force BUILD_ARCH=${{ matrix.arch }}
- name: Compile PROJ
run: |
make -f gdal-makefile proj-force BUILD_ARCH=${{ matrix.arch }}
- name: Compile GDAL
run: |
make -f gdal-makefile gdal-force BUILD_ARCH=${{ matrix.arch }}
- name: Collect deps
run: |
make -f collect-deps-makefile BUILD_ARCH=${{ matrix.arch }}
- name: Create packages
run: |
make -f publish-makefile pack BUILD_ARCH=${{ matrix.arch }} BUILD_NUMBER_TAIL=${{ github.run_number }}
- name: Store metadata as artifact
uses: actions/upload-artifact@v4
with:
name: metadata-osx-${{ matrix.arch }}
path: |
shared/bundle/targets/
package-build/*.csproj
overwrite: true
- name: GDAL formats osx
uses: actions/upload-artifact@v4
with:
name: formats-osx-${{ matrix.arch }}
path: |
tests/gdal-formats/
overwrite: true
- name: Store packages as artifact
uses: actions/upload-artifact@v4
with:
name: packages-osx-${{ matrix.arch }}
path: nuget/*.nupkg
overwrite: true
TestPackages-MacOS:
strategy:
matrix:
os: [macos-14, macos-13]
include:
- os: macos-14
arch: arm64
- os: macos-13
arch: x64
needs: BuildNugetPackages-MacOS
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: osx
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: packages-osx-${{ matrix.arch }}
path: nuget/
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: NuGet - set credentials
uses: ./.github/actions/set-credentials
with:
api-key-github: ${{ secrets.API_KEY_GITHUB }}
api-key-nuget: ${{ secrets.API_KEY_NUGET }}
api-user-github: ${{ secrets.API_USER_GITHUB }}
api-user-nuget: ${{ secrets.API_USER_NUGET }}
- name: Test packages
run: |
make -f test-makefile BUILD_ARCH=${{ matrix.arch }} BUILD_NUMBER_TAIL=${{ github.run_number }}
PushPackages-Macos:
needs: TestPackages-MacOS
runs-on: ubuntu-latest
defaults:
run:
working-directory: osx
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact - packages
uses: actions/download-artifact@v4
with:
pattern: packages-osx*
merge-multiple: true
path: nuget/
- name: Download artifact - metadata
uses: actions/download-artifact@v4
with:
pattern: metadata-osx*
merge-multiple: true
- name: NuGet - set credentials
uses: ./.github/actions/set-credentials
with:
api-key-github: ${{ secrets.API_KEY_GITHUB }}
api-key-nuget: ${{ secrets.API_KEY_NUGET }}
api-user-github: ${{ secrets.API_USER_GITHUB }}
api-user-nuget: ${{ secrets.API_USER_NUGET }}
- name: Build bundle
run: |
make -f publish-makefile pack-bundle-only CAT_NAME=osx PRERELEASE=${{ env.IS_PRE_RELEASE }} BUILD_NUMBER_TAIL=${{ github.run_number }}
- name: Store packages as artifact
uses: actions/upload-artifact@v4
with:
name: packages-osx-final
path: nuget/*.nupkg
overwrite: true
- name: Push packages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
make -f ../unix/push-packages-makefile BUILD_NUMBER_TAIL=${{ github.run_number }} API_KEY_GITHUB=${{ secrets.API_KEY_GITHUB }} API_KEY_NUGET=${{ secrets.API_KEY_NUGET }}