144 lines
4.1 KiB
YAML
Raw Normal View History

2021-01-11 00:18:30 -05:00
#--------------------------------------------------------------------------------
# Workflow configuration
#--------------------------------------------------------------------------------
2020-12-25 00:02:06 -06:00
name: Build
2021-01-10 22:39:23 -05:00
on:
2021-01-11 00:18:30 -05:00
push: # Run on push
paths-ignore: # File patterns to ignore
- '**.md' # Ignore changes to *.md files
2021-01-10 22:39:23 -05:00
2021-01-11 00:18:30 -05:00
pull_request: # Run on pull-request
paths-ignore: # File-patterns to ignore
- '**.md' # Ignore changes to *.md files
#--------------------------------------------------------------------------------
# Define application name & version
#--------------------------------------------------------------------------------
env:
2021-01-12 00:23:03 -05:00
APP_NAME: "SerialStudio"
PRO_FILE: "Serial-Studio.pro"
NICE_APP_NAME: "Serial Studio"
APP_VERSION: "1.0.5"
APP_QMLDIR: "assets/qml"
2021-01-11 00:18:30 -05:00
#--------------------------------------------------------------------------------
# Workflow jobs (GNU/Linux, macOS & Windows)
#--------------------------------------------------------------------------------
2020-12-24 23:29:05 -06:00
jobs:
2021-01-11 00:18:30 -05:00
#
# GNU/Linux build (we run on Ubuntu 16.04 to generate AppImage)
#
2020-12-24 23:34:12 -06:00
build-linux:
2021-01-10 22:39:23 -05:00
runs-on: ubuntu-16.04
2020-12-24 23:29:05 -06:00
steps:
2021-01-11 00:18:30 -05:00
#
# Checkout the repository
#
2021-01-10 23:01:02 -05:00
- name: Checkout repository
uses: actions/checkout@v2
2020-12-24 23:54:11 -06:00
2021-01-11 00:18:30 -05:00
#
# Install Qt
#
2020-12-24 23:54:11 -06:00
- name: Install Qt
uses: jurplel/install-qt-action@v2
2021-01-10 23:04:49 -05:00
with:
modules: qtcharts
2021-01-10 22:39:23 -05:00
2021-01-11 00:18:30 -05:00
#
# Install additional dependencies, stolen from:
# https://github.com/mapeditor/tiled/blob/master/.github/workflows/packages.yml
#
2021-01-10 22:39:23 -05:00
- name: Install dependencies
2021-01-10 23:01:02 -05:00
run: |
sudo apt-get update
2021-01-10 22:50:50 -05:00
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev
2020-12-24 23:54:11 -06:00
2021-01-11 00:18:30 -05:00
#
# Compile the application
#
2021-01-10 23:01:02 -05:00
- name: Compile
run: |
2021-01-11 00:20:43 -05:00
qmake ${PRO_FILE} CONFIG+=release PREFIX=/usr
2021-01-10 23:10:42 -05:00
make -j8
2021-01-10 23:01:02 -05:00
2021-01-11 00:18:30 -05:00
#
# Create the AppImage
#
2021-01-10 23:01:02 -05:00
- name: Create AppImage
run: |
2021-01-10 23:10:42 -05:00
make INSTALL_ROOT=appdir install
2021-01-10 22:50:50 -05:00
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod a+x linuxdeployqt
2021-01-11 00:28:26 -05:00
./linuxdeployqt appdir/usr/share/applications/*.desktop -appimage -bundle-non-qt-libs -extra-plugins=imageformats/libqsvg.so -qmldir=${APP_QMLDIR}
2021-01-11 00:18:30 -05:00
#
# Rename AppImage to match "%AppName%-%Version%-Linux.AppImage" format
#
- name: Rename AppImage
run: mv *.AppImage ${APP_NAME}-${APP_VERSION}-Linux.AppImage
#
# Upload AppImage to build artifacts
#
2021-01-10 22:39:23 -05:00
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
2021-01-11 00:40:32 -05:00
name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-Linux.AppImage
path: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-Linux.AppImage
2021-01-10 22:39:23 -05:00
2021-01-11 00:18:30 -05:00
#
# macOS build
#
2020-12-25 21:17:44 -06:00
build-mac:
runs-on: macos-latest
steps:
2021-01-11 00:18:30 -05:00
#
# Checkout the repository
#
2021-01-10 23:01:02 -05:00
- name: Checkout repository
uses: actions/checkout@v2
2020-12-25 21:17:44 -06:00
2021-01-11 00:18:30 -05:00
#
# Install Qt
#
2020-12-25 21:17:44 -06:00
- name: Install Qt
uses: jurplel/install-qt-action@v2
2021-01-10 23:04:49 -05:00
with:
modules: qtcharts
2021-01-11 00:18:30 -05:00
#
# Install "create-dmg" with homebrew, we need it later
#
2021-01-10 22:39:23 -05:00
- name: Install create-dmg
run: brew install create-dmg
2021-01-11 00:18:30 -05:00
#
# Compile application
#
2020-12-25 21:17:44 -06:00
- name: Compile
2021-01-10 23:01:02 -05:00
run: |
2021-01-11 00:20:43 -05:00
qmake ${PRO_FILE} CONFIG+=release
2021-01-11 00:18:30 -05:00
make -j8
#
# Create DMG file & rename it to "%AppName%-%Version%-macOS.dmg"
#
2021-01-10 23:01:02 -05:00
- name: Create DMG
2021-01-11 23:49:42 -05:00
run: |
2021-01-12 00:23:03 -05:00
mv "*.app" "${NICE_APP_NAME}.app"
2021-01-10 22:50:50 -05:00
make dmg
2021-01-11 00:18:30 -05:00
mv *.dmg ${APP_NAME}-${APP_VERSION}-macOS.dmg
#
# Upload DMG to build artifacts
#
2021-01-10 22:39:23 -05:00
- name: Upload DMG
uses: actions/upload-artifact@v2
with:
2021-01-11 00:40:32 -05:00
name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-macOS.dmg
path: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-macOS.dmg