Skip to content

Commit

Permalink
test all build systems
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Oct 17, 2024
1 parent 47e3212 commit 6b6d78a
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 6 deletions.
108 changes: 103 additions & 5 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,108 @@ on:
- macOSbuildTest

jobs:
PC_Application_Ubuntu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libusb-1.0-0-dev qt6-tools-dev qt6-base-dev libqt6charts6-dev libqt6svg6-dev libgl-dev
qtchooser -install qt6 $(which qmake6)
- name: Get build timestamp
id: id_date
run: echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT

- name: Get app version
id: id_version
run: |
cd Software/LibreCAL-GUI
fw_major=`grep -oP '(?<=FW_MAJOR=)[0-9]+' LibreCAL-GUI.pro`
fw_minor=`grep -oP '(?<=FW_MINOR=)[0-9]+' LibreCAL-GUI.pro`
fw_patch=`grep -oP '(?<=FW_PATCH=)[0-9]+' LibreCAL-GUI.pro`
echo "app_version=v$fw_major.$fw_minor.$fw_patch-${{steps.id_date.outputs.timestamp}}" >> $GITHUB_OUTPUT
- name: Build application
run: |
cd Software/LibreCAL-GUI
export QT_SELECT=qt6
qmake LibreCAL-GUI.pro
make -j9
shell: bash

- name: Upload artifact
env:
LIBRECAL_VERSION: "${{steps.id_version.outputs.app_version}}"
uses: actions/upload-artifact@v3
with:
name: LibreCAL-GUI-Ubuntu-${{env.LIBRECAL_VERSION}}
path: Software/LibreCAL-GUI/LibreCAL-GUI

PC_Application_Windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.2.0'
arch: 'win64_mingw81'
modules: 'qtcharts'

- name: Download libusb
run: |
curl -o libusb.7z -L https://github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.7z
7z x libusb.7z -r -olibusb
Xcopy /E /I /Y libusb\include ..\Qt\6.2.0\mingw81_64\include
Xcopy /E /I /Y libusb\MinGW64\static Software\LibreCAL-GUI
shell: cmd

- name: Get build timestamp
shell: msys2 {0}
id: id_date
run: echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT

- name: Get app version
id: id_version
shell: msys2 {0}
run: |
cd Software/LibreCAL-GUI
fw_major=`grep -oP '(?<=FW_MAJOR=)[0-9]+' LibreCAL-GUI.pro`
fw_minor=`grep -oP '(?<=FW_MINOR=)[0-9]+' LibreCAL-GUI.pro`
fw_patch=`grep -oP '(?<=FW_PATCH=)[0-9]+' LibreCAL-GUI.pro`
echo "app_version=v$fw_major.$fw_minor.$fw_patch-${{steps.id_date.outputs.timestamp}}" >> $GITHUB_OUTPUT
- name: Build application
run: |
cd Software/LibreCAL-GUI
qmake LibreCAL-GUI.pro
make -j9
shell: cmd

- name: Deploy application
run: |
cd Software/LibreCAL-GUI/release
del *.o *.cpp
windeployqt.exe .
copy ..\..\..\..\Qt\6.2.0\mingw81_64\bin\libwinpthread-1.dll .
copy ..\..\..\..\Qt\6.2.0\mingw81_64\bin\libgcc_s_seh-1.dll .
copy "..\..\..\..\Qt\6.2.0\mingw81_64\bin\libstdc++-6.dll" .
copy ..\..\..\..\Qt\6.2.0\mingw81_64\bin\Qt6OpenGL.dll .
shell: cmd

- name: Upload
uses: actions/upload-artifact@v3
env:
LIBRECAL_VERSION: "${{steps.id_version.outputs.app_version}}"
with:
name: GUI_Windows-${{env.LIBRECAL_VERSION}}
path: Software/LibreCAL-GUI/release

PC_Application_OSX:
runs-on: macos-latest
steps:
Expand All @@ -14,11 +116,7 @@ jobs:
- name: Install dependencies
run: |
brew install qt@6 libusb pcre
- name: Test pkg-config
run: |
pkg-config --cflags libusb-1.0
- name: Set Environment
run: |
echo "/usr/local/opt/qt@6/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion Software/LibreCAL-GUI/LibreCAL-GUI.pro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LIBS += -lusb-1.0
unix:LIBS += -L/usr/lib/
win32:LIBS += -L"$$_PRO_FILE_PWD_" # Github actions placed libusb here
osx:INCPATH += /usr/local/include
osx:LIBS += -L/usr/local/lib $(shell pkg-config --libs libusb-1.0)
osx:LIBS += -L/usr/local/lib

mac{
QT_CONFIG -= no-pkg-config
Expand Down
6 changes: 6 additions & 0 deletions Software/LibreCAL-GUI/Util/usbinbuffer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef USBINBUFFER_H
#define USBINBUFFER_H

#include <QtGlobal>
#ifdef Q_OS_MACOS
#include <libusb.h>
#else
#include <libusb-1.0/libusb.h>
#endif

#include <condition_variable>

#include <QObject>
Expand Down
6 changes: 6 additions & 0 deletions Software/LibreCAL-GUI/usbdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

#include "Util/usbinbuffer.h"

#include <QtGlobal>
#ifdef Q_OS_MACOS
#include <libusb.h>
#else
#include <libusb-1.0/libusb.h>
#endif

#include <QString>
#include <set>
#include <functional>
Expand Down

0 comments on commit 6b6d78a

Please sign in to comment.