175 lines
6.3 KiB
YAML
175 lines
6.3 KiB
YAML
|
|
name: core-release
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/core-release.yml
|
|
|
|
jobs:
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Create maplibre-native-headers.tar.gz
|
|
run: |
|
|
tar czf maplibre-native-headers.tar.gz \
|
|
include \
|
|
vendor/maplibre-native-base/include \
|
|
vendor/maplibre-native-base/deps/variant/include \
|
|
vendor/maplibre-native-base/deps/geometry.hpp/include \
|
|
vendor/maplibre-native-base/deps/geojson.hpp/include \
|
|
vendor/metal-cpp \
|
|
vendor/expected-lite/include
|
|
|
|
- name: Create Release
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
gh release create core-${{ github.sha }} \
|
|
--draft=true \
|
|
--prerelease=false \
|
|
--latest=false \
|
|
--title "core-${{ github.sha }}" \
|
|
maplibre-native-headers.tar.gz LICENSES.core.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-macos:
|
|
needs: [create-release]
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- run: brew install webp libuv
|
|
|
|
- uses: taiki-e/install-action@d6912b47771be2c443ec90dbb3d28e023987e782 # v2.62.1
|
|
with:
|
|
tool: armerge@2
|
|
|
|
- name: Build mbgl-core for macOS
|
|
run: |
|
|
cmake --preset macos -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF
|
|
cmake --build build-macos --target mbgl-core
|
|
|
|
- name: Rename artifact
|
|
run: |
|
|
cp build-macos/libmbgl-core.a libmaplibre-native-core-macos-arm64-metal.a
|
|
cp build-macos/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
|
|
|
- name: Upload macOS artifacts
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: macos-metal-build
|
|
path: |
|
|
libmaplibre-native-core-macos-arm64-metal.a
|
|
libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
|
|
|
- name: Upload macOS artifacts (release)
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-macos-arm64-metal.a
|
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
build-linux:
|
|
needs: [create-release]
|
|
runs-on: ${{ matrix.runner.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- renderer: opengl
|
|
runner: { os: ubuntu-latest, arch: x64 }
|
|
- renderer: vulkan
|
|
runner: { os: ubuntu-latest, arch: x64 }
|
|
- renderer: opengl
|
|
runner: { os: ubuntu-24.04-arm, arch: arm64 }
|
|
- renderer: vulkan
|
|
runner: { os: ubuntu-24.04-arm, arch: arm64 }
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: .github/scripts/install-linux-deps
|
|
|
|
- uses: taiki-e/install-action@d6912b47771be2c443ec90dbb3d28e023987e782 # v2.62.1
|
|
with:
|
|
tool: armerge@2
|
|
|
|
- name: Build mbgl-core for Linux
|
|
run: |
|
|
cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
|
cmake --build build-linux-${{ matrix.renderer }} --target mbgl-core
|
|
|
|
- name: Rename artifact
|
|
run: |
|
|
cp build-linux-${{ matrix.renderer }}/libmbgl-core.a libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
cp build-linux-${{ matrix.renderer }}/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
|
|
- name: Upload Linux artifacts
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}-build
|
|
path: |
|
|
libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
|
|
- name: Upload Linux artifacts (release)
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
build-windows:
|
|
needs: [create-release]
|
|
runs-on: windows-2022
|
|
strategy:
|
|
matrix:
|
|
renderer: [opengl, egl, vulkan]
|
|
steps:
|
|
- run: |
|
|
git config --system core.longpaths true
|
|
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
|
|
|
- name: Build mbgl-core for Windows
|
|
run: |
|
|
cmake --preset windows-${{ matrix.renderer }}-core -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
|
cmake --build --preset windows-${{ matrix.renderer }}-core
|
|
|
|
- name: Rename artifact
|
|
run: Copy-Item build-windows-${{ matrix.renderer }}/mbgl-core.lib maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
|
|
|
- name: Upload Windows artifact
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: windows-${{ matrix.renderer }}-build
|
|
path: |
|
|
maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
|
|
|
- name: Upload Windows artifact (release)
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: gh release upload core-${{ github.sha }} maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|