Add windows support (#707)
Co-authored-by: acalcutt <acalcutt@techidiots.net> Co-authored-by: Bart Louwers <bart.louwers@gmail.com> Co-authored-by: Ovidiu Voda <ovi.voda@gmail.com>
This commit is contained in:
111
.github/workflows/node-release.yml
vendored
111
.github/workflows/node-release.yml
vendored
@@ -59,6 +59,8 @@ jobs:
|
||||
arch: x86_64
|
||||
- runs-on: macos-12-arm
|
||||
arch: arm64
|
||||
- runs-on: windows-2022
|
||||
arch: x86_64
|
||||
needs: bump_version
|
||||
continue-on-error: true
|
||||
env:
|
||||
@@ -70,24 +72,27 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Latest Version
|
||||
run: git pull
|
||||
|
||||
- name: Setup submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true
|
||||
|
||||
- name: Get OS Architecture
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
run: uname -m
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies macOS
|
||||
if: runner.os == 'macOS'
|
||||
- name: Install dependencies (MacOS)
|
||||
if: runner.os == 'MacOS'
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||
@@ -99,7 +104,7 @@ jobs:
|
||||
brew list glfw || brew install glfw
|
||||
brew list libuv || brew install libuv
|
||||
|
||||
- name: Install dependencies Linux
|
||||
- name: Install dependencies (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
@@ -119,68 +124,70 @@ jobs:
|
||||
libc++abi-9-dev
|
||||
/usr/sbin/update-ccache-symlinks
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: npm ci
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Prepare ccache
|
||||
run: ccache --clear --set-config cache_dir=~/.ccache
|
||||
- name: Set up msvc dev cmd (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: ccache-v1
|
||||
- name: Update ccache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
choco.exe upgrade ccache
|
||||
ccache.exe --version
|
||||
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up ccache
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
||||
restore-keys: |
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
|
||||
|
||||
- name: Clear ccache statistics
|
||||
run: |
|
||||
ccache --zero-stats --set-config cache_dir=~/.ccache
|
||||
ccache --max-size=2G --set-config cache_dir=~/.ccache
|
||||
ccache --show-stats --set-config cache_dir=~/.ccache
|
||||
|
||||
- name: CMake
|
||||
- name: Configure maplibre-gl-native (MacOS)
|
||||
if: runner.os == 'MacOS'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
|
||||
cmake . -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
|
||||
- name: CMake
|
||||
- name: Configure maplibre-gl-native (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
cmake . -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_COMPILER=gcc-10 \
|
||||
-DCMAKE_CXX_COMPILER=g++-10
|
||||
|
||||
- name: Build
|
||||
- name: Configure maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
cmake . -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache.exe
|
||||
|
||||
- name: Build maplibre-gl-native (MacOS/Linux)
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
run: |
|
||||
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
|
||||
|
||||
#- name: Run render tests on macOS
|
||||
# if: runner.os == 'macOS'
|
||||
# run: ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json
|
||||
|
||||
#- name: Upload render test artifacts
|
||||
# uses: actions/upload-artifact@v3
|
||||
# if: always()
|
||||
# with:
|
||||
# name: render-query-test-results
|
||||
# path: metrics/macos-xcode11-release-style.html
|
||||
|
||||
#- name: Test
|
||||
# if: runner.os == 'Linux'
|
||||
# run: xvfb-run --auto-servernum npm test
|
||||
|
||||
#- name: Test
|
||||
# if: runner.os == 'macOS' && matrix.arch != 'arm64'
|
||||
# run: npm test
|
||||
|
||||
# On PRs make sure that the npm package can be packaged.
|
||||
#- name: Pack
|
||||
# if: github.ref != 'refs/heads/main'
|
||||
# run: |
|
||||
# npm pack --dry-run
|
||||
- name: Build maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
- name: Publish X64 Release to Github
|
||||
if: github.ref == 'refs/heads/main' && matrix.arch == 'x86_64'
|
||||
|
||||
Reference in New Issue
Block a user