Skip to content

Use vcpkg to build macOS packages #876

Use vcpkg to build macOS packages

Use vcpkg to build macOS packages #876

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: PR validation
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
package-macos:
name: Build macOS libraries
runs-on: macos-14
timeout-minutes: 500
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
export ARCH=${{ matrix.arch }}
./pkg/mac/build-static-library.sh
- name: Zip artifact
run: |
cd ./pkg/mac/.install
zip -r macos-${{ matrix.arch }}.zip ./include/pulsar/* ./lib/*
cp macos-${{ matrix.arch }}.zip ../../../
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.arch }}.zip
path: macos-${{ matrix.arch }}.zip
- name: Test static libraries
run: |
export PULSAR_DIR=$PWD/pkg/mac/.install
echo "Build with dynamic library"
clang++ win-examples/example.cc -o dynamic.out -std=c++11 -arch ${{ matrix.arch }} -I $PULSAR_DIR/include -L $PULSAR_DIR/lib -Wl,-rpath $PULSAR_DIR/lib -lpulsar
./dynamic.out
echo "Build with static library"
clang++ win-examples/example.cc -o static.out -std=c++11 -arch ${{ matrix.arch }} -I $PULSAR_DIR/include $PULSAR_DIR/lib/libpulsarwithdeps.a -framework SystemConfiguration -framework CoreFoundation
./static.out
check-completion:
name: Check Completion
runs-on: ubuntu-latest
needs: [package-macos]
steps:
- run: true