Skip to content

Commit

Permalink
build: Add GitHub Action workflow on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
GilBenkoe committed Jun 14, 2021
1 parent 734af97 commit 2ad595f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/builder-workflow.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions build/travis/job_macos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build/travis/job_macos/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 2ad595f

Please sign in to comment.