chore(ci): branch filters and cleanup (#6856)
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
name: Run tests and package firmware
|
name: Run tests and package firmware
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
paths: &trigger-paths
|
paths: &trigger-paths
|
||||||
- '.github/workflows/build_fw.yml'
|
- '.github/workflows/build_fw.yml'
|
||||||
- 'cmake/**'
|
- 'cmake/**'
|
||||||
@@ -10,8 +15,10 @@ on:
|
|||||||
- '.gitmodules'
|
- '.gitmodules'
|
||||||
- 'CMakeLists.txt'
|
- 'CMakeLists.txt'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
paths: *trigger-paths
|
paths: *trigger-paths
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
@@ -2,12 +2,20 @@ name: Linux Companion
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
paths: &trigger-paths
|
paths: &trigger-paths
|
||||||
- '.github/workflows/linux_cpn.yml'
|
- '.github/workflows/linux_cpn.yml'
|
||||||
- 'companion/**'
|
- 'companion/**'
|
||||||
- 'tools/build-companion.sh'
|
- 'tools/build-companion.sh'
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
paths: *trigger-paths
|
paths: *trigger-paths
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -2,12 +2,20 @@ name: MacOSX Companion
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
paths: &trigger-paths
|
paths: &trigger-paths
|
||||||
- '.github/workflows/macosx_cpn.yml'
|
- '.github/workflows/macosx_cpn.yml'
|
||||||
- 'companion/**'
|
- 'companion/**'
|
||||||
- 'tools/build-companion.sh'
|
- 'tools/build-companion.sh'
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
paths: *trigger-paths
|
paths: *trigger-paths
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -2,9 +2,17 @@
|
|||||||
name: Validate fw.json
|
name: Validate fw.json
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
paths:
|
paths:
|
||||||
- 'fw.json'
|
- 'fw.json'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
paths:
|
paths:
|
||||||
- 'fw.json'
|
- 'fw.json'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
name: Windows Companion 32-bit
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/win_cpn-32.yml'
|
|
||||||
- 'companion/**'
|
|
||||||
- 'tools/build-companion.sh'
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
||||||
BUILD_TYPE: Release
|
|
||||||
CMAKE_GENERATOR: "MSYS Makefiles"
|
|
||||||
QT_VERSION: "5.15.2"
|
|
||||||
MINGW_VERSION: "win32_mingw81"
|
|
||||||
MINGW_PATH: "mingw81_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 curl tar mingw-w64-i686-toolchain
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
pacman -S --noconfirm mingw-w64-i686-cmake \
|
|
||||||
mingw-w64-i686-python-pip \
|
|
||||||
mingw-w64-i686-python-pillow \
|
|
||||||
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 \
|
|
||||||
mingw-w64-i686-openssl
|
|
||||||
SETUPTOOLS_USE_DISTUTILS=stdlib pip install lz4
|
|
||||||
python -m pip install clang jinja2 lz4
|
|
||||||
|
|
||||||
- name: Download and unpack dfu-util
|
|
||||||
run: |
|
|
||||||
curl -LO https://dfu-util.sourceforge.net/releases/dfu-util-0.11-binaries.tar.xz && \
|
|
||||||
tar -xf dfu-util-0.11-binaries.tar.xz
|
|
||||||
cp dfu-util-0.11-binaries/win32/dfu-util-static.exe /mingw32/bin/dfu-util.exe
|
|
||||||
cp dfu-util-0.11-binaries/win32/libusb-1.0.dll /mingw32/bin/libusb-1.0.dll
|
|
||||||
cp dfu-util-0.11-binaries/win32/libusb-1.0.dll.a /mingw32/bin/libusb-1.0.dll.a
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
|
|
||||||
- name: Check out the repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- 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 \
|
|
||||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
|
|
||||||
- name: Compose release filename
|
|
||||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
|
||||||
run: echo "artifact_name=edgetx-cpn-win32-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Archive production artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: "${{ env.artifact_name }}"
|
|
||||||
path: ${{github.workspace}}/output
|
|
||||||
retention-days: 15
|
|
||||||
@@ -2,12 +2,20 @@ name: Windows Companion 64-bit
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
paths: &trigger-paths
|
paths: &trigger-paths
|
||||||
- '.github/workflows/win_cpn-64.yml'
|
- '.github/workflows/win_cpn-64.yml'
|
||||||
- 'companion/**'
|
- 'companion/**'
|
||||||
- 'tools/build-companion.sh'
|
- 'tools/build-companion.sh'
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- '[0-9]+.[0-9]+'
|
||||||
paths: *trigger-paths
|
paths: *trigger-paths
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -1,287 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
## Bash script to show how to get EdgeTX source from GitHub,
|
|
||||||
## how to build TX16S firmware, Companion, Simulator, radio simulator
|
|
||||||
## library and how to create an installation package.
|
|
||||||
## Let it run as normal user in MSYS2 MinGW 64-bit console (blue icon).
|
|
||||||
##
|
|
||||||
## Note: This script is tested to work properly only for the branch it stems from.
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
export BRANCH_NAME="main" # main|2.9|...
|
|
||||||
export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t15pro|t16|t18|nv14|commando8|tx15
|
|
||||||
|
|
||||||
export BUILD_OPTIONS="-DDEFAULT_MODE=2 -DGVARS=YES"
|
|
||||||
|
|
||||||
echo "Building ${fw_name}"
|
|
||||||
case $RADIO_TYPE in
|
|
||||||
x9lite)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9LITE"
|
|
||||||
;;
|
|
||||||
x9lites)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9LITES"
|
|
||||||
;;
|
|
||||||
x7)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7"
|
|
||||||
;;
|
|
||||||
x7access)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=ACCESS -DPXX1=YES"
|
|
||||||
;;
|
|
||||||
t12)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T12 -DINTERNAL_MODULE_MULTI=ON"
|
|
||||||
;;
|
|
||||||
mt12)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=MT12 -DINTERNAL_MODULE_MULTI=ON"
|
|
||||||
;;
|
|
||||||
gx12)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=GX12 -DINTERNAL_MODULE_MULTI=ON"
|
|
||||||
;;
|
|
||||||
tx12)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TX12"
|
|
||||||
;;
|
|
||||||
tx12mk2)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TX12MK2"
|
|
||||||
;;
|
|
||||||
boxer)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=BOXER"
|
|
||||||
;;
|
|
||||||
t8)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T8"
|
|
||||||
;;
|
|
||||||
zorro)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=ZORRO"
|
|
||||||
;;
|
|
||||||
pocket)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=POCKET"
|
|
||||||
;;
|
|
||||||
tlite)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TLITE"
|
|
||||||
;;
|
|
||||||
tpro)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TPRO"
|
|
||||||
;;
|
|
||||||
t20)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T20"
|
|
||||||
;;
|
|
||||||
t20v2)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T20V2"
|
|
||||||
;;
|
|
||||||
t12max)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T12MAX"
|
|
||||||
;;
|
|
||||||
t14)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T14"
|
|
||||||
;;
|
|
||||||
lr3pro)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=LR3PRO"
|
|
||||||
;;
|
|
||||||
xlite)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=XLITE"
|
|
||||||
;;
|
|
||||||
xlites)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=XLITES"
|
|
||||||
;;
|
|
||||||
x9d)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9D"
|
|
||||||
;;
|
|
||||||
x9dp)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9D+"
|
|
||||||
;;
|
|
||||||
x9dp2019)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9D+ -DPCBREV=2019"
|
|
||||||
;;
|
|
||||||
x9e)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9E"
|
|
||||||
;;
|
|
||||||
x9e-hall)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X9E -DSTICKS=HORUS"
|
|
||||||
;;
|
|
||||||
x10)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10"
|
|
||||||
;;
|
|
||||||
x10express)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=EXPRESS -DPXX1=YES"
|
|
||||||
;;
|
|
||||||
x12s)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X12S"
|
|
||||||
;;
|
|
||||||
t15)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T15 -DINTERNAL_MODULE_CRSF=ON"
|
|
||||||
;;
|
|
||||||
t15pro)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=T15PRO -DINTERNAL_MODULE_CRSF=ON"
|
|
||||||
;;
|
|
||||||
t16)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON"
|
|
||||||
;;
|
|
||||||
t18)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T18"
|
|
||||||
;;
|
|
||||||
tx15)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=TX15"
|
|
||||||
;;
|
|
||||||
tx16s)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=TX16S"
|
|
||||||
;;
|
|
||||||
nv14)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=NV14"
|
|
||||||
;;
|
|
||||||
commando8)
|
|
||||||
BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=COMMANDO8"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unknown target: $RADIO_TYPE"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PAUSEAFTEREACHLINE="false" # true|false
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
export PROJ_DIR="${HOME}/edgetx"
|
|
||||||
export SOURCE_DIR="${HOME}/edgetx/edgetx_${BRANCH_NAME}"
|
|
||||||
export BUILD_OUTPUT_DIR="${SOURCE_DIR}/build-output-${RADIO_TYPE}"
|
|
||||||
|
|
||||||
function log() {
|
|
||||||
echo ""
|
|
||||||
echo "=== [INFO] $*"
|
|
||||||
}
|
|
||||||
function fail() {
|
|
||||||
echo "=== [ERROR] $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
function check_command() {
|
|
||||||
result=$1
|
|
||||||
cli_info=$2
|
|
||||||
if [[ $result -ne 0 ]]; then
|
|
||||||
fail "${cli_info} (exit-code=$result)"
|
|
||||||
else
|
|
||||||
log "${cli_info} - OK"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "RADIO_TYPE: ${RADIO_TYPE}"
|
|
||||||
echo "BRANCH_NAME: ${BRANCH_NAME}"
|
|
||||||
echo "SOURCE_DIR: ${SOURCE_DIR}"
|
|
||||||
echo "BUILD_OUTPUT_DIR: ${BUILD_OUTPUT_DIR}"
|
|
||||||
echo "BUILD_OPTIONS: ${BUILD_OPTIONS}"
|
|
||||||
|
|
||||||
# Parse argument(s)
|
|
||||||
for arg in "$@"
|
|
||||||
do
|
|
||||||
if [[ $arg == "--pause" ]]; then
|
|
||||||
PAUSEAFTEREACHLINE="true"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
STEP=1
|
|
||||||
echo "=== Step $((STEP++)): Creating a directory for EdgeTX ==="
|
|
||||||
mkdir -p ${PROJ_DIR} && cd ${PROJ_DIR}
|
|
||||||
check_command $? "mkdir -p ${PROJ_DIR} && cd ${PROJ_DIR}"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "${SOURCE_DIR}" ]]; then
|
|
||||||
echo "=== Step $((STEP++)): Fetching EdgeTX source tree (${BRANCH_NAME} branch) from GitHub ==="
|
|
||||||
git clone --recursive -b ${BRANCH_NAME} https://github.com/EdgeTX/edgetx.git ${SOURCE_DIR}
|
|
||||||
check_command $? "git clone --recursive -b ${BRANCH_NAME} https://github.com/EdgeTX/edgetx.git ${SOURCE_DIR}"
|
|
||||||
cd ${SOURCE_DIR}
|
|
||||||
else
|
|
||||||
echo "=== Step $((STEP++)): updating EdgeTX source tree (${BRANCH_NAME} branch) from GitHub ==="
|
|
||||||
cd ${SOURCE_DIR}
|
|
||||||
check_command $? "cd ${SOURCE_DIR}"
|
|
||||||
git checkout ${BRANCH_NAME}
|
|
||||||
check_command $? "git checkout ${BRANCH_NAME}"
|
|
||||||
git pull
|
|
||||||
check_command $? "git pull"
|
|
||||||
git submodule update --init --recursive
|
|
||||||
check_command $? "git submodule update --init --recursive"
|
|
||||||
fi
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Creating build output directory ==="
|
|
||||||
[[ -d ${BUILD_OUTPUT_DIR} ]] && rm -rf ${BUILD_OUTPUT_DIR}
|
|
||||||
mkdir -p ${BUILD_OUTPUT_DIR} && cd ${BUILD_OUTPUT_DIR}
|
|
||||||
check_command $? "mkdir -p ${BUILD_OUTPUT_DIR} && cd ${BUILD_OUTPUT_DIR}"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Running CMake for ${RADIO_TYPE} as an example ==="
|
|
||||||
cmake -G "MSYS Makefiles" -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/6.9.0/mingw_64 ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../
|
|
||||||
check_command $? "cmake -G MSYS Makefiles -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/6.9.0/mingw_64 -DSDL2_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Running Make configure ==="
|
|
||||||
make configure
|
|
||||||
check_command $? "make configure"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Building firmware binary ==="
|
|
||||||
make -C arm-none-eabi -j`nproc` firmware
|
|
||||||
check_command $? "make -C arm-none-eabi -j`nproc` firmware"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Renaming firmware binary ==="
|
|
||||||
mv arm-none-eabi/firmware.bin arm-none-eabi/fw_${RADIO_TYPE}_release.bin
|
|
||||||
check_command $? "mv arm-none-eabi/firmware.bin arm-none-eabi/fw_${RADIO_TYPE}_release.bin"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Building radio simulator library ==="
|
|
||||||
make -C native -j`nproc` libsimulator
|
|
||||||
check_command $? "make -C native -j`nproc` libsimulator"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Building Companion ==="
|
|
||||||
make -C native -j`nproc` companion
|
|
||||||
check_command $? "make -C native -j`nproc` companion"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Building Simulator ==="
|
|
||||||
make -C native -j`nproc` simulator
|
|
||||||
check_command $? "make -C native -j`nproc` simulator"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Making an installer ==="
|
|
||||||
make -C native installer
|
|
||||||
check_command $? "make -C native installer"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Done. \n\n"
|
|
||||||
echo "RADIO_TYPE=${RADIO_TYPE}"
|
|
||||||
echo ""
|
|
||||||
echo "firmware (${RADIO_TYPE}): ${BUILD_OUTPUT_DIR}/arm-none-eabi/fw_${RADIO_TYPE}_release.bin"
|
|
||||||
echo "Companion installer: ${BUILD_OUTPUT_DIR}/native/companion/companion-windows-x.x.x.exe"
|
|
||||||
echo "Companion : ${BUILD_OUTPUT_DIR}/native/Release/companion.exe"
|
|
||||||
echo "Simulator : ${BUILD_OUTPUT_DIR}/native/Release/simulator.exe"
|
|
||||||
echo "Simulator library : ${BUILD_OUTPUT_DIR}/native/Release/libedgetx-${RADIO_TYPE}-simulator.dll"
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
## Bash script to setup EdgeTX development environment first stage.
|
|
||||||
## Let it run as normal user in MSYS2 MSYS console (violet icon).
|
|
||||||
|
|
||||||
PAUSEAFTEREACHLINE="false"
|
|
||||||
STEP=1
|
|
||||||
# Parse argument(s)
|
|
||||||
for arg in "$@"
|
|
||||||
do
|
|
||||||
if [[ $arg == "--pause" ]]; then
|
|
||||||
PAUSEAFTEREACHLINE="true"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Updating MSYS2 base packages ==="
|
|
||||||
pacman -Su --noconfirm
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing system wide packages ==="
|
|
||||||
pacman -S --noconfirm git make mingw-w64-x86_64-toolchain
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "This stage has finished. Please close the MSYS console and continue to stage 2 in MinGW 64-bit console (blue icon)."
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
## Bash script to setup EdgeTX development environment second stage.
|
|
||||||
## Let it run as normal user in MSYS2 MinGW 64-bit console (blue icon).
|
|
||||||
|
|
||||||
PAUSEAFTEREACHLINE="false"
|
|
||||||
STEP=1
|
|
||||||
# Parse argument(s)
|
|
||||||
for arg in "$@"
|
|
||||||
do
|
|
||||||
if [[ $arg == "--pause" ]]; then
|
|
||||||
PAUSEAFTEREACHLINE="true"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing packages ==="
|
|
||||||
pacman -S --noconfirm mingw-w64-x86_64-cmake \
|
|
||||||
mingw-w64-x86_64-python-pip \
|
|
||||||
mingw-w64-x86_64-python-pillow \
|
|
||||||
mingw-w64-x86_64-python-lz4 \
|
|
||||||
mingw-w64-x86_64-libjpeg-turbo \
|
|
||||||
mingw-w64-x86_64-zlib \
|
|
||||||
mingw-w64-x86_64-libtiff \
|
|
||||||
mingw-w64-x86_64-freetype \
|
|
||||||
mingw-w64-x86_64-lcms2 \
|
|
||||||
mingw-w64-x86_64-libwebp \
|
|
||||||
mingw-w64-x86_64-openjpeg2 \
|
|
||||||
mingw-w64-x86_64-libimagequant \
|
|
||||||
mingw-w64-x86_64-libraqm \
|
|
||||||
mingw-w64-x86_64-SDL2 \
|
|
||||||
mingw-w64-x86_64-clang \
|
|
||||||
mingw-w64-x86_64-nsis \
|
|
||||||
mingw-w64-x86_64-dfu-util \
|
|
||||||
mingw-w64-x86_64-openssl
|
|
||||||
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Downloading GNU Arm Embedded Toolchain ==="
|
|
||||||
wget https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi.zip
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing GNU Arm Embedded Toolchain ==="
|
|
||||||
unzip arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi.zip -d gcc-arm-none-eabi
|
|
||||||
rm arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi.zip
|
|
||||||
mv gcc-arm-none-eabi/ /opt/gcc-arm-none-eabi
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Adding GNU Arm Embedded Toolchain to PATH of current user ==="
|
|
||||||
echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing Python packages ==="
|
|
||||||
# Python 3.11 introduced the managed environment breakage aka PEP 668.
|
|
||||||
# since we are building a self-contained environment the simple fix is to add --break-system-packages to all pip installs
|
|
||||||
python3 -m pip install --break-system-package -U setuptools && \
|
|
||||||
python3 -m pip install --break-system-package \
|
|
||||||
asciitree \
|
|
||||||
jinja2 \
|
|
||||||
pillow \
|
|
||||||
clang==14.0.0 \
|
|
||||||
lz4 \
|
|
||||||
pyelftools
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Downloading aqt ==="
|
|
||||||
wget "https://github.com/miurahr/aqtinstall/releases/download/Continuous/aqt.exe"
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing Qt build environment ==="
|
|
||||||
./aqt.exe install-qt windows desktop 6.9.0 win64_mingw -m qtmultimedia qtserialport
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Setting up build environment has finished. You can now start building EdgeTX firmware and binaries!"
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
## Bash script to setup EdgeTX development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine.
|
|
||||||
## Let it run as normal user and when asked, give sudo credentials
|
|
||||||
|
|
||||||
PAUSEAFTEREACHLINE="false"
|
|
||||||
STEP=1
|
|
||||||
# Parse argument(s)
|
|
||||||
for arg in "$@"
|
|
||||||
do
|
|
||||||
if [[ $arg == "--pause" ]]; then
|
|
||||||
PAUSEAFTEREACHLINE="true"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $(lsb_release -rs) != "20.04" ]]; then
|
|
||||||
echo "ERROR: Not running on Ubuntu 20.04!"
|
|
||||||
echo "Terminating the script now."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Checking if i386 requirement is satisfied ==="
|
|
||||||
OUTPUT=x$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) || :
|
|
||||||
if [ "$OUTPUT" != "xi386" ]; then
|
|
||||||
echo "Need to install i386 architecture first."
|
|
||||||
sudo dpkg --add-architecture i386
|
|
||||||
else
|
|
||||||
echo "i386 requirement satisfied!"
|
|
||||||
fi
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Updating Ubuntu package lists. Please provide sudo credentials, when asked ==="
|
|
||||||
sudo apt-get -y update
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing packages ==="
|
|
||||||
sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libsdl2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev libqt5serialport5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 libclang-6.0-dev python-is-python3
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Installing Python packages ==="
|
|
||||||
sudo python3 -m pip install filelock asciitree jinja2 pillow==7.2.0 clang==6.0.0 future lxml lz4
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Fetching GNU Arm Embedded Toolchains ==="
|
|
||||||
# EdgeTX uses GNU Arm Embedded Toolchain version 14.2.rel1
|
|
||||||
wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Unpacking GNU Arm Embedded Toolchains ==="
|
|
||||||
pv arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz | tar xJf -
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Removing the downloaded archives ==="
|
|
||||||
rm arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Moving GNU Arm Embedded Toolchains to /opt ==="
|
|
||||||
sudo mv arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi /opt/gcc-arm-none-eabi
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Adding GNU Arm Embedded Toolchain to PATH of current user ==="
|
|
||||||
echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Removing modemmanager (conflicts with DFU) ==="
|
|
||||||
sudo apt-get -y remove modemmanager
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Fetching USB DFU host utility ==="
|
|
||||||
wget -q --show-progress --progress=bar:force:noscroll http://dfu-util.sourceforge.net/releases/dfu-util-0.11.tar.gz
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Unpacking USB DFU host utility ==="
|
|
||||||
pv dfu-util-0.11.tar.gz | tar xzf -
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Building and Installing USB DFU host utility ==="
|
|
||||||
cd dfu-util-0.11/
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
cd ..
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
|
||||||
read
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Step $((STEP++)): Removing the downloaded archive and build folder of USB DFU host utility ==="
|
|
||||||
rm dfu-util-0.11.tar.gz
|
|
||||||
rm -rf dfu-util-0.11
|
|
||||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
|
||||||
echo "Step finished."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Finished setting up EdgeTX development environment."
|
|
||||||
echo "Please execute: source ~/.bashrc"
|
|
||||||
Reference in New Issue
Block a user