From 2ad595fc6885ae31cbb9ca9c567ac106fc867ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gil=20Benk=C3=B6?= <38266358+GilBenkoe@users.noreply.github.com> Date: Mon, 14 Jun 2021 01:02:09 +0200 Subject: [PATCH] build: Add GitHub Action workflow on macOS --- .github/workflows/builder-workflow.yaml | 25 +++++++++++++++++++++++++ build/travis/job_macos/build.sh | 4 ++-- build/travis/job_macos/install.sh | 4 ++-- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/builder-workflow.yaml diff --git a/.github/workflows/builder-workflow.yaml b/.github/workflows/builder-workflow.yaml new file mode 100644 index 00000000..0135b3d0 --- /dev/null +++ b/.github/workflows/builder-workflow.yaml @@ -0,0 +1,25 @@ +name: macOS build + +on: [push] + +jobs: + buildMacOS: + name: macOS + runs-on: macos-10.15 + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - run: echo "QT_SHORT_VERSION=5.8" >> $GITHUB_ENV + - run: echo "QT_LONG_VERSION=5.8.0" >> $GITHUB_ENV + - run: echo "QT_INSTALLER_ROOT=qt-opensource-mac-x64-clang-${QT_LONG_VERSION}" >> $GITHUB_ENV + - run: echo "QT_INSTALLER_FILENAME=${QT_INSTALLER_ROOT}.dmg" >> $GITHUB_ENV + - run: echo "QT_PATH=$HOME/qt" >> $GITHUB_ENV + - run: echo "QT_MACOS=$QT_PATH/$QT_SHORT_VERSION/clang_64" >> $GITHUB_ENV + - run: echo "$QT_MACOS/bin" >> $GITHUB_PATH + - run: ./build/travis/job_macos/install.sh + - run: ./build/travis/job_macos/build.sh + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: MachinekitClient-Development-macOS-master-x64 + path: build.release/MachinekitClient.dmg diff --git a/build/travis/job_macos/build.sh b/build/travis/job_macos/build.sh index f0519abe..18d825b8 100755 --- a/build/travis/job_macos/build.sh +++ b/build/travis/job_macos/build.sh @@ -4,7 +4,7 @@ set -e set -x # do not build mac for PR -if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then +if [ ! -z "${TRAVIS_PULL_REQUEST}" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then exit 0 fi @@ -88,7 +88,7 @@ if [ "${upload}" != "true" ]; then fi platform=x64 # skip pull requests - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then + if [ ! -z "${TRAVIS_PULL_REQUEST}" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then upload= fi fi diff --git a/build/travis/job_macos/install.sh b/build/travis/job_macos/install.sh index 7451d829..4de31451 100755 --- a/build/travis/job_macos/install.sh +++ b/build/travis/job_macos/install.sh @@ -3,7 +3,7 @@ set -x # do not build mac for PR -if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then +if [ ! -z "${TRAVIS_PULL_REQUEST}" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then exit 0 fi @@ -76,7 +76,7 @@ echo "QT_LONG_VERSION QT_LONG_VERSION" if [[ "$QMAKE_VERSION" != "${QT_LONG_VERSION}" ]]; then rm -rf $QT_PATH echo "Downloading Qt" - wget -c --no-check-certificate -nv https://download.qt.io/archive/qt/${QT_SHORT_VERSION}/${QT_LONG_VERSION}/${QT_INSTALLER_FILENAME} + wget -c --no-check-certificate -nv https://download.qt.io/new_archive/qt/${QT_SHORT_VERSION}/${QT_LONG_VERSION}/${QT_INSTALLER_FILENAME} hdiutil mount ${QT_INSTALLER_FILENAME} cp -rf /Volumes/${QT_INSTALLER_ROOT}/${QT_INSTALLER_ROOT}.app $HOME/${QT_INSTALLER_ROOT}.app QT_INSTALLER_EXE=$HOME/${QT_INSTALLER_ROOT}.app/Contents/MacOS/${QT_INSTALLER_ROOT}