Files
MapLibreParticleLab/.github/workflows/core-release.yml

186 lines
6.8 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: recursive
- name: Create maplibre-native-headers.tar.gz
run: |
tar czf maplibre-native-headers.tar.gz \
include \
platform/default/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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: recursive
- run: brew install webp libuv
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
with:
tool: armerge@2
- name: Build mbgl-core for macOS
run: |
cmake --preset macos-metal -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF -DMLN_CREATE_AMALGAMATION=ON
cmake --build build-macos-metal --target mbgl-core
- name: Rename artifact
run: |
cp build-macos-metal/libmbgl-core.a libmaplibre-native-core-macos-arm64-metal.a
cp build-macos-metal/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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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 }}
env:
PRESET_RENDERER: ${{ matrix.preset_renderer || matrix.renderer }}
strategy:
matrix:
include:
- renderer: opengl
runner: { os: ubuntu-latest, arch: x64 }
- renderer: vulkan
runner: { os: ubuntu-latest, arch: x64 }
- renderer: wgpu
preset_renderer: webgpu-wgpu
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: recursive
- name: Install dependencies
run: .github/scripts/install-linux-deps
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
with:
tool: armerge@2
- name: Build mbgl-core for Linux
run: |
cmake --preset "linux-${PRESET_RENDERER}" -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_CREATE_AMALGAMATION=ON
cmake --build "build-linux-${PRESET_RENDERER}" --target mbgl-core
- name: Verify Linux WebGPU amalgamation
if: matrix.renderer == 'wgpu'
run: |
.github/scripts/check-linux-webgpu-amalgam "build-linux-${PRESET_RENDERER}/libmbgl-core-amalgam.a"
- name: Rename artifact
run: |
cp "build-linux-${PRESET_RENDERER}/libmbgl-core.a" "libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a"
cp "build-linux-${PRESET_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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Build mbgl-core for Windows
run: |
cmake --preset windows-${{ matrix.renderer }} -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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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 }}