diff --git a/appveyor.yml b/appveyor.yml index 254ce8c88..38d892df9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,10 @@ skip_tags: true image: - Visual Studio 2019 - macos-monterey + - Ubuntu2204 environment: + APPVEYOR_SAVE_CACHE_ON_ERROR: true GC_GOOGLE_CALENDAR_CLIENT_SECRET: secure: hwjHTrSAMEbKd9PA+5x/zI4x5Uk4KQm1hdfZzkwiu8k= GC_GOOGLE_DRIVE_CLIENT_ID: @@ -57,13 +59,23 @@ init: # Setup NSIS - cmd: set PATH=%PATH%;C:\"Program Files (x86)"\NSIS -# macOS -# Setup QT 6.5 -- sh: export QTDIR=$HOME/Qt/6.5/macos -- sh: export PATH=$HOME/Qt/6.5/macos/bin:$PATH -- sh: qmake --version -# Setup Xcode 14.2 -- sh: sudo xcode-select -s /Applications/Xcode-14.2.0.app +# Linux / macOS +- sh: >- + if $CI_LINUX; then + export OS_NAME=linux + # Setup QT 5.15 + export QTDIR=$HOME/Qt/5.15/gcc_64 + export PATH=$HOME/Qt/5.15/gcc_64/bin:$PATH + qmake --version + else + export OS_NAME=macos + # Setup QT 6.5 + export QTDIR=$HOME/Qt/6.5/macos + export PATH=$HOME/Qt/6.5/macos/bin:$PATH + qmake --version + # Setup Xcode 14.2 + sudo xcode-select -s /Applications/Xcode-14.2.0.app + fi cache: - gc-ci-libs.zip -> appveyor.yml @@ -137,8 +149,8 @@ install: - cmd: echo GSL_INCLUDES=c:\tools\vcpkg\installed\x64-windows\include >> src\gcconfig.pri - cmd: echo GSL_LIBS=-Lc:\tools\vcpkg\installed\x64-windows\lib -lgsl -lgslcblas >> src\gcconfig.pri -# macOS -- sh: appveyor/macos/install.sh +# Linux / macOS +- sh: bash appveyor/$OS_NAME/install.sh before_build: @@ -159,10 +171,12 @@ before_build: # Avoid macro redefinition warnings - cmd: echo DEFINES+=_MATH_DEFINES_DEFINED >> src\gcconfig.pri -# macOS -- sh: appveyor/macos/before_build.sh +# Linux / macOS +- sh: bash appveyor/$OS_NAME/before_build.sh +# Define GC version string, only for tagged builds +- sh: if $APPVEYOR_REPO_TAG; then echo DEFINES+=GC_VERSION=VERSION_STRING >> src/gcconfig.pri; fi -# Patch Secrets.h (Windows and macOS) +# Patch Secrets.h (Windows / Linux / macOS) - ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_CALENDAR_CLIENT_SECRET__', $env:GC_GOOGLE_CALENDAR_CLIENT_SECRET | Set-Content src\Core\Secrets.h - ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_ID__', $env:GC_GOOGLE_DRIVE_CLIENT_ID | Set-Content src\Core\Secrets.h - ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_SECRET__', $env:GC_GOOGLE_DRIVE_CLIENT_SECRET | Set-Content src\Core\Secrets.h @@ -192,7 +206,7 @@ build_script: - cmd: if not exist qwt\lib\qwt.lib jom -j1 sub-qwt - cmd: jom -j4 sub-src -# macOS +# Linux / macOS - sh: qmake build.pro -r QMAKE_CXXFLAGS_WARN_ON+="-Wno-unused-private-field -Wno-c++11-narrowing -Wno-deprecated-declarations -Wno-deprecated-register -Wno-nullability-completeness -Wno-sign-compare -Wno-inconsistent-missing-override" QMAKE_CFLAGS_WARN_ON+="-Wno-deprecated-declarations -Wno-sign-compare" - sh: if test ! -f qwt/lib/libqwt.a; then make sub-qwt; fi - sh: make -j4 sub-src @@ -231,8 +245,8 @@ after_build: - ps: if ($isWindows) { Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value false } - ps: if ($isWindows -And $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -Match "\[publish binaries\]") { Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value true } -# macOS -- sh: appveyor/macos/after_build.sh +# Linux / macOS +- sh: bash appveyor/$OS_NAME/after_build.sh test_script: @@ -242,16 +256,24 @@ test_script: - ps: if ($isWindows) { CertUtil -hashfile GoldenCheetah_v3.7_x64.exe sha256 | Select-Object -First 2 | Add-Content GCversionWindows.txt } - cmd: type GCversionWindows.txt -# macOS -- sh: src/GoldenCheetah.app/Contents/MacOS/GoldenCheetah --version 2>GCversionMacOS.txt -- sh: git log -1 >> GCversionMacOS.txt -- sh: shasum -a 256 GoldenCheetah_v3.7_x64.dmg | cut -f 1 -d ' ' >> GCversionMacOS.txt -- sh: cat GCversionMacOS.txt +# Linux / macOS +- sh: >- + if $CI_LINUX; then + ./GoldenCheetah_v3.7_x64.AppImage --version 2>GCversionLinux.txt + git log -1 >> GCversionLinux.txt + shasum -a 256 GoldenCheetah_v3.7_x64.AppImage | cut -f 1 -d ' ' >> GCversionLinux.txt + cat GCversionLinux.txt + else + src/GoldenCheetah.app/Contents/MacOS/GoldenCheetah --version 2>GCversionMacOS.txt + git log -1 >> GCversionMacOS.txt + shasum -a 256 GoldenCheetah_v3.7_x64.dmg | cut -f 1 -d ' ' >> GCversionMacOS.txt + cat GCversionMacOS.txt + fi artifacts: # Windows - path: GoldenCheetah_v3.7_x64.exe - name: GCinstallerWindows + name: GCwindowsInstaller - path: GCversionWindows.txt name: GCversionWindows # macOS @@ -259,6 +281,11 @@ artifacts: name: GCmacOSpackage - path: GCversionMacOS.txt name: GCversionMacOS +# Linux +- path: GoldenCheetah_v3.7_x64.AppImage + name: GClinuxAppImage +- path: GCversionLinux.txt + name: GCversionLinux deploy: # deploy continuous builds to GitHub release diff --git a/appveyor/linux/after_build.sh b/appveyor/linux/after_build.sh new file mode 100644 index 000000000..5b07d3360 --- /dev/null +++ b/appveyor/linux/after_build.sh @@ -0,0 +1,74 @@ +#!/bin/bash +set -ev + +### This script should be run from GoldenCheetah src directory after build +cd src +if [ ! -x ./GoldenCheetah ] +then echo "Build GoldenCheetah and execute from distribution src"; exit 1 +fi + +### Create AppDir and start populating +mkdir -p appdir + +# Executable +cp GoldenCheetah appdir + +# Desktop file +cat >appdir/GoldenCheetah.desktop <> src/gcconfig.pri +echo PYTHONINCLUDES = -I/usr/include/python3.7 >> src/gcconfig.pri +echo PYTHONLIBS = -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m >> src/gcconfig.pri +# GSL +echo GSL_LIBS = -lgsl -lgslcblas -lm >> src/gcconfig.pri +# TrainerDay Query API +echo DEFINES += GC_WANT_TRAINERDAY_API >> src/gcconfig.pri +echo DEFINES += GC_TRAINERDAY_API_PAGESIZE=25 >> src/gcconfig.pri +cat src/gcconfig.pri + +# update translations +lupdate src/src.pro +exit diff --git a/appveyor/linux/install.sh b/appveyor/linux/install.sh new file mode 100644 index 000000000..eb6087ff0 --- /dev/null +++ b/appveyor/linux/install.sh @@ -0,0 +1,60 @@ +#!/bin/bash +set -ev + +sudo apt-get update -qq +sudo apt-get install -qq flex libpulse-dev +sudo apt-get install -qq libglu1-mesa-dev +sudo apt-get install -qq libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev +sudo apt-get install -qq libsamplerate0-dev +sudo apt-get install -qq libical-dev + +# Add VLC 3 +sudo apt-get install -y vlc libvlc-dev libvlccore-dev + +# R 4.0 +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 +sudo add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" +sudo apt-get update -qq +sudo apt-get install -qq r-base-dev +R --version + +# D2XX - refresh cache if folder is empty +if [ -z "$(ls -A D2XX)" ]; then + mkdir -p D2XX + wget --no-verbose https://ftdichip.com/wp-content/uploads/2022/07/libftd2xx-x86_64-1.4.27.tgz + tar xf libftd2xx-x86_64-1.4.27.tgz -C D2XX +fi + +# SRMIO +git clone https://github.com/rclasen/srmio.git +cd srmio +sh genautomake.sh +./configure --disable-shared --enable-static +make --silent -j3 +sudo make install +cd .. + +# LIBUSB +sudo apt-get install -qq libusb-1.0-0-dev libudev-dev + +# Add Python 3.7 and SIP +sudo add-apt-repository -y ppa:deadsnakes/ppa +sudo apt-get update -qq +sudo apt-get install -qq python3.7-dev python3.7-distutils +python3.7 --version +wget --no-verbose https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.8/sip-4.19.8.tar.gz +tar xf sip-4.19.8.tar.gz +cd sip-4.19.8 +python3.7 configure.py --incdir=/usr/include/python3.7 +make +sudo make install +cd .. + +# GSL +sudo apt-get -qq install libgsl-dev + +# Install fuse2 required to run older AppImages, and patchelf to fix QtWebEngineProcess +sudo add-apt-repository -y universe +sudo apt install libfuse2 patchelf + +exit