Added Cirrus CI builds for Mac ARM64.

This commit is contained in:
Gonzalo Exequiel Pedone 2023-05-01 23:37:02 -03:00
parent 607beb353d
commit eac75f966c
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
5 changed files with 72 additions and 22 deletions

38
.cirrus.yml Normal file
View file

@ -0,0 +1,38 @@
mac_task:
matrix:
- name: MacOS Ventura (13.0)
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
env:
UPLOAD: 0
- name: MacOS Monterrey (12.0)
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-base:latest
env:
UPLOAD: 1
env:
GITHUB_TOKEN: ENCRYPTED[80867839ea1cae036c24d6491696b07aeee67dee7e558714d0031f84e338ec415d266fb19e482d7430826121cfe39d2c]
HOMEBREW_PATH: /opt/homebrew
NJOBS: 4
env:
only_if: ${CIRRUS_TAG} == ""
DAILY_BUILD: 1
env:
only_if: ${CIRRUS_TAG} != ""
DAILY_BUILD: 0
macos_instance:
cpu: 2
memory: 4G
timeout_in: 60m
install_script:
- chmod +x ports/ci/mac/install_deps.sh
- ./ports/ci/mac/install_deps.sh
script:
- chmod +x ports/ci/mac/build.sh
- ./ports/ci/mac/build.sh
deploy_script:
- chmod +x ports/ci/mac/deploy.sh
- ./ports/ci/mac/deploy.sh
upload_script:
- chmod +x ports/ci/mac/upload.sh
- ./ports/ci/mac/upload.sh

View file

@ -3,6 +3,7 @@ name: Mac
on: [push, pull_request]
env:
HOMEBREW_PATH: /usr/local
NJOBS: 4
jobs:
@ -13,27 +14,14 @@ jobs:
matrix:
include:
- os: macos-13
architecture: x64
upload: 0
- os: macos-12
architecture: x64
upload: 0
- os: macos-11
architecture: x64
upload: 1
# - os: macos-13
# architecture: arm64
# upload: 0
# - os: macos-12
# architecture: arm64
# upload: 0
# - os: macos-11
# architecture: arm64
# upload: 1
runs-on: ${{ matrix.os }}
env:
UPLOAD: ${{ matrix.upload }}
ARCHITECTURE: ${{ matrix.architecture }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies

View file

@ -25,12 +25,6 @@ if [ -z "${DISABLE_CCACHE}" ]; then
EXTRA_PARAMS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache"
fi
if [ "${ARCHITECTURE}" == arm64 ]; then
EXTRA_PARAMS="${EXTRA_PARAMS} -DCMAKE_OSX_ARCHITECTURES=arm64"
export CFLAGS="-arch arm64"
export CXXFLAGS="-arch arm64"
fi
INSTALL_PREFIX=${PWD}/package-data
mkdir -p build

View file

@ -26,12 +26,9 @@ fi
brew update
brew upgrade
brew link --overwrite numpy
brew install \
ccache \
cmake \
p7zip \
pkg-config \
python
brew link --overwrite python
brew link python

33
ports/ci/mac/upload.sh Normal file
View file

@ -0,0 +1,33 @@
#!/bin/bash
# Webcamoid, webcam capture application.
# Copyright (C) 2023 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
#
# Web-Site: http://webcamoid.github.io/
if [[ "${UPLOAD}" != 1 ]]; then
exit 0
fi
brew install gh
if [[ "$CIRRUS_RELEASE" == "" ]]; then
releaseName=daily-build
else
releaseName=$CIRRUS_RELEASE
fi
gh release upload "$releaseName" packages/mac/* --clobber -R "$CIRRUS_REPO_FULL_NAME"