1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

Rewrite the git history of all attempts to build windows companion

This commit is contained in:
Bertrand Songis 2023-09-29 10:44:12 +02:00
parent 791329de86
commit d9fca463f4
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
11 changed files with 198 additions and 113 deletions

View file

@ -1,10 +1,10 @@
name: Linux nightly Companion
name: Nightly - Linux Companion
on:
workflow_run:
workflows: ["MacOSX nightly Companion"]
types:
- completed
# workflow_run:
# workflows: ["MacOSX nightly Companion"]
# types:
# - completed
workflow_dispatch:
@ -18,27 +18,28 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Init
run: sudo apt update
- name: Install dependencies
run: sudo apt-get -y install build-essential cmake gcc git lib32ncurses5 lib32z1 libfox-1.6-dev libsdl1.2-dev
run: sudo apt-get -y install build-essential cmake gcc git lib32ncurses6 lib32z1 libfox-1.6-dev libsdl1.2-dev
qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev
software-properties-common wget zip libgtest-dev libclang1-7 python3-pip
- name: Install cross compiler
run: wget -q https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 &&
tar xjf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 &&
mv gcc-arm-none-eabi-4_7-2013q3 /opt/gcc-arm-none-eabi &&
echo "/opt/gcc-arm-none-eabi/bin:/opentx/code/radio/util" >> $GITHUB_PATH
- name: Install ARM toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '6-2017-q2'
- name: Install pillow
run: python -m pip install filelock clang pillow
- uses: actions/checkout@v2
- name: Check out the repo
uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands

View file

@ -1,4 +1,4 @@
name: MacOSX nightly Companion
name: Nightly - MacOSX Companion
on:
schedule:
@ -16,10 +16,10 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-10.15
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
@ -27,13 +27,13 @@ jobs:
run: cmake -E make_directory ${{github.workspace}}/build
- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
version: '5.12.9'
setup-python: 'false'
- name: Install dependencies
run: python -m pip install --upgrade pip Pillow
run: python3 -m pip install --upgrade pip Pillow
- name: Install ARM toolchain
uses: fiam/arm-none-eabi-gcc@v1

View file

@ -0,0 +1,117 @@
name: Nightly - Windows Companion
on:
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CMAKE_GENERATOR: "MSYS Makefiles"
QT_VERSION: "5.12.9"
MINGW_VERSION: "win32_mingw73"
MINGW_PATH: "mingw73_32"
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: git make
- name: Install GCC 11.2
run: |
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-gcc-libs-11.2.0-10-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-gcc-11.2.0-10-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-crt-git-9.0.0.6448.b03cbfb95-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-i686-gcc-libs-11.2.0-10-any.pkg.tar.zst \
mingw-w64-i686-gcc-11.2.0-10-any.pkg.tar.zst \
mingw-w64-i686-crt-git-9.0.0.6448.b03cbfb95-1-any.pkg.tar.zst
- name: Install Dependencies
run: |
pacman -S --noconfirm mingw-w64-i686-cmake \
mingw-w64-i686-python-pip \
mingw-w64-i686-python-pillow \
mingw-w64-i686-python-lz4 \
mingw-w64-i686-libjpeg-turbo \
mingw-w64-i686-zlib \
mingw-w64-i686-libtiff \
mingw-w64-i686-freetype \
mingw-w64-i686-lcms2 \
mingw-w64-i686-libwebp \
mingw-w64-i686-openjpeg2 \
mingw-w64-i686-libimagequant \
mingw-w64-i686-libraqm \
mingw-w64-i686-SDL2 \
mingw-w64-i686-clang \
mingw-w64-i686-nsis
python -m pip install clang
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: 'install-qt-action-win32'
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
tools: 'tools_opensslv3_x64'
- name: Install ARM toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '6-2017-q2'
directory: "C:/arm-none-eabi"
- name: Check out the repo
uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Build
working-directory: ${{github.workspace}}
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
mkdir output && \
CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \
QT_TOOLS_OPENSSL_ROOT_PATH=$RUNNER_WORKSPACE/Qt/Tools/OpenSSL/Win_x86 \
PATH=$PATH:/c/arm-none-eabi/bin ./tools/build-companion-nightly.sh "${{github.workspace}}" "${{github.workspace}}/output/"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: companion-nightly
path: ${{github.workspace}}/output
retention-days: 1
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: companion-nightly
- name: Display structure of downloaded files
run: ls -R
- uses: pyTooling/Actions/releaser@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: 'nightly'
files: companion*.*
rm: true

View file

@ -1,4 +1,4 @@
name: Do MacOSX release Companion
name: Release - MacOSX Companion
on: workflow_dispatch
@ -15,7 +15,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory

View file

@ -1,37 +0,0 @@
name: OpenTX Commit Tests
on:
push:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- COMPANION
- MAMBO
- TANGO
- ARM9X
- X9LITE
- X7
- XLITE
- X9
- COLORLCD
container:
image: ghcr.io/raphaelcoeffic/opentx-commit-tests
volumes:
- ${{ github.workspace }}:/src
steps:
-
name: Check out the repo
uses: actions/checkout@v2
with:
submodules: recursive
-
name: Test ${{ matrix.target }}
env:
FLAVOR: ${{ matrix.target }}
run: |
echo "Running commit tests"
./tools/commit-tests.sh

View file

@ -25,7 +25,7 @@ jobs:
steps:
-
name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
-

View file

@ -2,7 +2,7 @@ project(OpenTX)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "3")
set(VERSION_REVISION "16")
set(VERSION_REVISION "15")
if(TEST_BUILD_WARNING OR ALLOW_NIGHTLY_BUILDS)
math(EXPR VERSION_REVISION "${VERSION_REVISION} + 1")
endif()

View file

@ -332,7 +332,7 @@ endif()
# Generate list of simulator plugins, used by all platforms
if(WIN32)
file(GLOB simulator_plugins "${CMAKE_BINARY_DIR}/Release/*opentx-*simulator${CMAKE_SHARED_LIBRARY_SUFFIX}")
file(GLOB simulator_plugins "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/*opentx-*simulator${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
file(GLOB simulator_plugins "${CMAKE_BINARY_DIR}/*opentx-*simulator${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
@ -407,11 +407,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
elseif(WIN32)
if(NOT WIN_DO_FULL_INSTALL)
# Just copy supporting DLLs to build folder
set(INSTALL_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(INSTALL_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")
message(STATUS "Partial install to " ${INSTALL_DESTINATION})
else()
# Full Windows installation with all supporting files
set(INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}")
set(INSTALL_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")
message(STATUS "Full install to " ${INSTALL_DESTINATION})
# companion & simulator binaries
install(TARGETS ${COMPANION_NAME} DESTINATION ${INSTALL_DESTINATION})
@ -433,7 +433,8 @@ elseif(WIN32)
if(MSVC)
set(wdqtopts ${wdqtopts} --no-compiler-runtime) # --compiler-runtime includes vcredist_x86, but we just copy the required DLLs manually
endif()
set(wdqtopts ${wdqtopts} -dir "\"${INSTALL_DESTINATION}\"" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release/${COMPANION_NAME}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release/${SIMULATOR_NAME}.exe")
set(wdqtopts ${wdqtopts} -dir "\"${INSTALL_DESTINATION}\"" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${COMPANION_NAME}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${SIMULATOR_NAME}.exe")
list(JOIN wdqtopts " " wdqtopts)
# Add installer command to execute windeployqt
message(STATUS "windeployqt command: ${QT_BIN_DIR}/windeployqt.exe ${wdqtopts}")

View file

@ -1,4 +1,4 @@
Copyright Š 2011-2019 OpenTX team
Copyright Š 2011-2023 OpenTX team
OpenTX Companion is based on code named eePe by author - Erez Raviv <erezraviv@gmail.com>

View file

@ -36,7 +36,6 @@
#endif
#if defined(STM32F4)
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h"
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h"

View file

@ -30,7 +30,7 @@ done
SRCDIR=$1
OUTDIR=$2
COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DTEST_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
COMMON_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DALLOW_NIGHTLY_BUILDS=YES -DTEST_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
if [ "$(uname)" = "Darwin" ]; then
COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'"
fi
@ -149,10 +149,14 @@ rm CMakeCache.txt
cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
make -j${JOBS} libsimulator
make -j${JOBS} package
if [ "$(uname)" = "Darwin" ]; then
cp *.dmg ${OUTDIR}
make -j${JOBS} package
cp *.dmg "${OUTDIR}"
elif [ "$(uname)" = "Linux" ]; then
make -j${JOBS} package
cp *.deb "${OUTDIR}"
else
cp *.deb ${OUTDIR}
cmake ${COMMON_OPTIONS} -DWIN_DO_FULL_INSTALL=YES -DSIMU_TARGET=NO ${SRCDIR}
make -j${JOBS} installer
cp companion/*.exe "${OUTDIR}"
fi