Skip to content

Commit

Permalink
build: Add GitHub Action workflow on macOS
Browse files Browse the repository at this point in the history
Also disable Travis CI #298, Bintray, small fixes.
  • Loading branch information
GilBenkoe committed Jun 14, 2021
1 parent c0b25d0 commit 389dbae
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/builder-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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: echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $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: MachinekitClient_Development-*-x64.dmg
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ matrix:
# - env: "JOB=AppImage_armhf"
# - env: "JOB=Android_armv7"
- env: "JOB=MacOSX"
include:
exclude:
# 1st parallel build job - debug build and tests
- env: "JOB=Test_x64"
addons:
Expand Down
8 changes: 4 additions & 4 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 All @@ -102,15 +102,15 @@ if [ "${upload}" ]; then
target="QtQuickVcp_Development"
fi
mv build.release/QtQuickVcp.tar.gz ${target}-${version}-MacOSX-${platform}.tar.gz
./build/travis/job_macos/bintray_lib.sh ${target}-${version}*.tar.gz
# ./build/travis/job_macos/bintray_lib.sh ${target}-${version}*.tar.gz

if [ $release -eq 1 ]; then
target="MachinekitClient"
else
target="MachinekitClient_Development"
fi
mv build.release/MachinekitClient.dmg ${target}-${version}-${platform}.dmg
./build/travis/job_macos/bintray_app.sh ${target}*.dmg
# ./build/travis/job_macos/bintray_app.sh ${target}*.dmg
else
echo "On branch '$branch' so dmg will not be uploaded." >&2
fi
8 changes: 4 additions & 4 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 All @@ -21,14 +21,14 @@ fi

brew update
brew install libtool automake autoconf pkg-config bash coreutils
brew install gnu-sed --with-default-names
brew install gnu-sed

# install zeromq
git clone https://github.com/zeromq/zeromq4-x.git
cd zeromq4-x
git checkout v4.0.8
sh autogen.sh
./configure --disable-static --enable-shared --prefix=/opt/local CC=clang CXX=clang++ CFLAGS="-arch x86_64" CXXFLAGS="-std=c++11 -stdlib=libstdc++ -O3 -arch x86_64" LDFLAGS="-stdlib=libstdc++"
./configure --disable-static --enable-shared --prefix=/opt/local CC=clang CXX=clang CFLAGS="-arch x86_64" CXXFLAGS="-std=c++11 -stdlib=libc++ -O3 -arch x86_64" LDFLAGS="-stdlib=libc++"
make
sudo make install
cd ..
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 389dbae

Please sign in to comment.