From eac75f966c8c9122bf491fe7982367713f5d24bb Mon Sep 17 00:00:00 2001 From: Gonzalo Exequiel Pedone Date: Mon, 1 May 2023 23:37:02 -0300 Subject: [PATCH] Added Cirrus CI builds for Mac ARM64. --- .cirrus.yml | 38 ++++++++++++++++++++++++++++++++++++ .github/workflows/mac.yml | 14 +------------ ports/ci/mac/build.sh | 6 ------ ports/ci/mac/install_deps.sh | 3 --- ports/ci/mac/upload.sh | 33 +++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 22 deletions(-) create mode 100644 .cirrus.yml create mode 100644 ports/ci/mac/upload.sh diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..58b6b00 --- /dev/null +++ b/.cirrus.yml @@ -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 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 83a9ead..5b248f2 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -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 diff --git a/ports/ci/mac/build.sh b/ports/ci/mac/build.sh index 079c842..3e01af8 100644 --- a/ports/ci/mac/build.sh +++ b/ports/ci/mac/build.sh @@ -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 diff --git a/ports/ci/mac/install_deps.sh b/ports/ci/mac/install_deps.sh index b65a4c4..c5f9cd0 100644 --- a/ports/ci/mac/install_deps.sh +++ b/ports/ci/mac/install_deps.sh @@ -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 diff --git a/ports/ci/mac/upload.sh b/ports/ci/mac/upload.sh new file mode 100644 index 0000000..7367e6e --- /dev/null +++ b/ports/ci/mac/upload.sh @@ -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 . +# +# 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"