Create macOS amalgamation for core releases (#3768)
This commit is contained in:
4
.github/scripts/install-linux-deps
vendored
4
.github/scripts/install-linux-deps
vendored
@@ -11,5 +11,5 @@ DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
|
||||
libopengl0 \
|
||||
mesa-vulkan-drivers \
|
||||
llvm \
|
||||
glslang-dev
|
||||
cargo install armerge@2.2.0
|
||||
glslang-dev \
|
||||
libbz2-dev
|
||||
|
||||
60
.github/workflows/core-release.yml
vendored
60
.github/workflows/core-release.yml
vendored
@@ -6,6 +6,9 @@ permissions:
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/core-release.yml
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
@@ -25,7 +28,9 @@ jobs:
|
||||
vendor/maplibre-native-base/deps/geojson.hpp/include \
|
||||
vendor/metal-cpp \
|
||||
vendor/maplibre-native-base/extras/expected-lite/include
|
||||
|
||||
- name: Create Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
gh release create core-${{ github.sha }} \
|
||||
--draft=false \
|
||||
@@ -44,16 +49,36 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- run: brew install webp libuv
|
||||
|
||||
- uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2
|
||||
with:
|
||||
tool: armerge@2
|
||||
|
||||
- name: Build mbgl-core for macOS
|
||||
run: |
|
||||
cmake --preset macos-core -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
||||
cmake --build --preset macos-core
|
||||
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
|
||||
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 artifact
|
||||
run: gh release upload core-${{ github.sha }} libmaplibre-native-core-macos-arm64-metal.a
|
||||
- name: Upload macOS artifacts
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/upload-artifact@v4
|
||||
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 }}
|
||||
|
||||
@@ -79,6 +104,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: .github/scripts/install-linux-deps
|
||||
|
||||
- uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2
|
||||
with:
|
||||
tool: armerge@2
|
||||
|
||||
- name: Build mbgl-core for Linux
|
||||
run: |
|
||||
cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
||||
@@ -89,7 +118,17 @@ jobs:
|
||||
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 artifact
|
||||
- name: Upload Linux artifacts
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/upload-artifact@v4
|
||||
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
|
||||
@@ -121,6 +160,15 @@ jobs:
|
||||
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@v4
|
||||
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 }}
|
||||
|
||||
9
.github/workflows/linux-ci.yml
vendored
9
.github/workflows/linux-ci.yml
vendored
@@ -78,6 +78,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: .github/scripts/install-linux-deps
|
||||
|
||||
- run: cargo install armerge@2.2.0
|
||||
# TODO: use below once
|
||||
# https://github.com/tux3/armerge/issues/14
|
||||
# is fixed
|
||||
|
||||
# - uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2
|
||||
# with:
|
||||
# tool: armerge@2
|
||||
|
||||
- if: matrix.variant.rust
|
||||
run: cargo install cxxbridge-cmd --version 1.0.157 --locked
|
||||
|
||||
|
||||
@@ -70,14 +70,6 @@
|
||||
"MLN_DARWIN_USE_LIBUV": "OFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "macos-core",
|
||||
"inherits": "macos",
|
||||
"cacheVariables": {
|
||||
"MLN_CORE_INCLUDE_DEPS": "ON",
|
||||
"MLN_WITH_GLFW": "OFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux",
|
||||
"hidden": true,
|
||||
@@ -185,7 +177,7 @@
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "macos-core",
|
||||
"configurePreset": "macos-core",
|
||||
"configurePreset": "macos",
|
||||
"targets": ["mbgl-core"]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -184,7 +184,7 @@ target_link_libraries(
|
||||
# Bundle system provided libraries
|
||||
if(NOT MLN_USE_BUILTIN_ICU AND NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND")
|
||||
message(STATUS "Found armerge: ${ARMERGE}")
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/find_static_library.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake)
|
||||
set(STATIC_LIBS "")
|
||||
|
||||
find_static_library(STATIC_LIBS NAMES png)
|
||||
|
||||
@@ -142,3 +142,29 @@ add_test(
|
||||
${PROJECT_SOURCE_DIR}/test/storage/server.js
|
||||
$<TARGET_FILE:mbgl-test-runner>
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
find_program(ARMERGE NAMES armerge)
|
||||
|
||||
if(NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND")
|
||||
message(STATUS "Found armerge: ${ARMERGE}")
|
||||
include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake)
|
||||
set(STATIC_LIBS "")
|
||||
|
||||
find_static_library(STATIC_LIBS NAMES png)
|
||||
find_static_library(STATIC_LIBS NAMES jpeg)
|
||||
find_static_library(STATIC_LIBS NAMES webp)
|
||||
find_static_library(STATIC_LIBS NAMES uv uv_a)
|
||||
|
||||
add_custom_command(
|
||||
TARGET mbgl-core
|
||||
POST_BUILD
|
||||
COMMAND armerge --keep-symbols 'mbgl.*' --output libmbgl-core-amalgam.a
|
||||
$<TARGET_FILE:mbgl-core>
|
||||
$<TARGET_FILE:freetype>
|
||||
$<TARGET_FILE:mbgl-vendor-csscolorparser>
|
||||
$<TARGET_FILE:harfbuzz>
|
||||
$<TARGET_FILE:mbgl-vendor-parsedate>
|
||||
${STATIC_LIBS}
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user