Skip to content

Commit

Permalink
build: Add GitHub CI/CD on macOS (machinekit#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
GilBenkoe committed Jun 19, 2021
1 parent c0b25d0 commit b53f2b7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 20 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/builder-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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: Release
run: |
filename=$(find . -name "$FILE")
tagname=$(echo "$filename" | sed -E 's|^[^-]*-(.*)-[^-]*$|\1|')
gh release create "$tagname" -n "$MESSAGE" -t "MachinekitClient-Development" "$filename"
env:
MESSAGE: |
MachinekitClient_Development for
x64 (64-bit Intel/AMD) Linux systems (Portable AppImages)
Windows 32bit and 64bit
x64 (64-bit Intel/AMD) MacOSX systems
FOR TESTING PURPOSES ONLY!
FILE: MachinekitClient_Development*x64.dmg
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

A remote UI implementation for [Machinekit](https://github.com/machinekit/machinekit) written in Qt/C++/QML. <a href="#contents">More info...</a>

| | Travis CI | AppVeyor |
|----------|:----:|:----:|
| Build Status | [![Build Status](https://api.travis-ci.org/machinekit/QtQuickVcp.svg?branch=master)](http://travis-ci.org/machinekit/QtQuickVcp) | [![Build Status](https://ci.appveyor.com/api/projects/status/h8pi1hm0gj15nmgm?svg=true)](https://ci.appveyor.com/project/machinekoder/qtquickvcp) |
| | Travis CI | AppVeyor | Github Actions |
|----------|:----:|:----:|:----:|
| Build Status | [![Build Status](https://api.travis-ci.org/machinekit/QtQuickVcp.svg?branch=master)](http://travis-ci.org/machinekit/QtQuickVcp) | [![Build Status](https://ci.appveyor.com/api/projects/status/h8pi1hm0gj15nmgm?svg=true)](https://ci.appveyor.com/project/machinekoder/qtquickvcp) | [![Build Status](https://github.com/machinekit/QtQuickVcp/actions/workflows/builder-workflow.yaml/badge.svg)](https://github.com/gb-g/QtQuickVcp/actions) |

[![Coverity Scan Build Status](https://scan.coverity.com/projects/10524/badge.svg)](https://scan.coverity.com/projects/qtquickvcp-qtquickvcp)

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
18 changes: 9 additions & 9 deletions src/pathview/glpathitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,58 +803,58 @@ GLPathItem::Position GLPathItem::calculateNewPosition(const machinetalk::Positio
if (newPosition.has_x()) {
position.x = m_activeOffsets.g92Offset.x;
position.x += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).x;
position.x += m_activeOffsets.toolOffset.x;
// position.x += m_activeOffsets.toolOffset.x;
position.x += newPosition.x();
}

if (newPosition.has_y()) {
position.y = m_activeOffsets.g92Offset.y;
position.y += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).y;
position.y += m_activeOffsets.toolOffset.y;
// position.y += m_activeOffsets.toolOffset.y;
position.y += newPosition.y();
}

if (newPosition.has_z()) {
position.z = m_activeOffsets.g92Offset.z;
position.z += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).z;
position.z += m_activeOffsets.toolOffset.z;
// position.z += m_activeOffsets.toolOffset.z;
position.z += newPosition.z();
}

if (newPosition.has_a()) {
position.a = m_activeOffsets.g92Offset.a;
position.a += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).a;
position.a += m_activeOffsets.toolOffset.a;
// position.a += m_activeOffsets.toolOffset.a;
position.a += newPosition.a();
}
if (newPosition.has_b()) {
position.b = m_activeOffsets.g92Offset.b;
position.b += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).b;
position.b += m_activeOffsets.toolOffset.b;
// position.b += m_activeOffsets.toolOffset.b;
position.b += newPosition.b();
}
if (newPosition.has_c()) {
position.c = m_activeOffsets.g92Offset.c;
position.c += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).c;
position.c += m_activeOffsets.toolOffset.c;
// position.c += m_activeOffsets.toolOffset.c;
position.c += newPosition.c();
}
if (newPosition.has_u()) {
position.u = m_activeOffsets.g92Offset.u;
position.u += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).u;
position.u += m_activeOffsets.toolOffset.u;
// position.u += m_activeOffsets.toolOffset.u;
position.u += newPosition.u();
}
if (newPosition.has_v()) {
position.v = m_activeOffsets.g92Offset.v;
position.v += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).v;
position.v += m_activeOffsets.toolOffset.v;
// position.v += m_activeOffsets.toolOffset.v;
position.v += newPosition.v();
}
if (newPosition.has_w()) {
position.w = m_activeOffsets.g92Offset.w;
position.w += m_activeOffsets.g5xOffsets.at(m_activeOffsets.g5xOffsetIndex-1).w;
position.w += m_activeOffsets.toolOffset.w;
// position.w += m_activeOffsets.toolOffset.w;
position.w += newPosition.w();
}

Expand Down

0 comments on commit b53f2b7

Please sign in to comment.