Sync edgetx to Gitea
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
name: 'Build Companion'
|
||||
inputs:
|
||||
os:
|
||||
description: 'OS / Architecture'
|
||||
required: true
|
||||
qt-version:
|
||||
description: 'Qt version'
|
||||
default: '6.9.3'
|
||||
qt-arch:
|
||||
description: 'Qt architecture'
|
||||
required: runner.os != 'Linux'
|
||||
sdl2-version:
|
||||
description: 'SDL2 version'
|
||||
default: '2.32.8'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: Install Qt
|
||||
if: runner.os != 'Linux'
|
||||
uses: jdpurcell/install-qt-action@v5
|
||||
env:
|
||||
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
|
||||
with:
|
||||
version: ${{ inputs.qt-version }}
|
||||
modules: 'qtmultimedia qtserialport'
|
||||
arch: ${{ inputs.qt-arch }}
|
||||
cache: true
|
||||
cache-key-prefix: 'install-qt-action-${{ inputs.qt-arch }}'
|
||||
|
||||
- name: Setup SDL2
|
||||
if: runner.os != 'Linux'
|
||||
shell: bash
|
||||
env:
|
||||
ACTION_PATH: ${{ github.action_path }}
|
||||
SDL2_VERSION: ${{ inputs.sdl2-version }}
|
||||
run: |
|
||||
"${ACTION_PATH}/setup-sdl2.sh" ${SDL2_VERSION}
|
||||
|
||||
- name: Setup MSVC
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
run: ${{ github.action_path }}/setup-msvc.ps1
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: 'Release'
|
||||
run: |
|
||||
mkdir output && \
|
||||
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
|
||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
|
||||
|
||||
- name: Compose release filename
|
||||
run: echo "artifact_name=edgetx-cpn-${{ inputs.os }}-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}"
|
||||
path: ${{github.workspace}}/output
|
||||
retention-days: 15
|
||||
@@ -0,0 +1,39 @@
|
||||
# setup-msvc.ps1
|
||||
# Runs vcvarsall.bat and exports only the new/changed environment
|
||||
# variables to GitHub Actions, avoiding clobbering existing ones.
|
||||
|
||||
param(
|
||||
[string]$Arch = "x64"
|
||||
)
|
||||
|
||||
# Find VS installation
|
||||
$vsWhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
$vsPath = & $vsWhere -latest -property installationPath
|
||||
$vcvars = Join-Path $vsPath "VC\Auxiliary\Build\vcvarsall.bat"
|
||||
|
||||
if (-not (Test-Path $vcvars)) {
|
||||
Write-Error "vcvarsall.bat not found at: $vcvars"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Snapshot environment before
|
||||
$before = @{}
|
||||
Get-ChildItem env: | ForEach-Object { $before[$_.Name] = $_.Value }
|
||||
|
||||
# Run vcvarsall.bat and import its environment into this process
|
||||
cmd /c "`"$vcvars`" $Arch && set" | ForEach-Object {
|
||||
if ($_ -match '^([^=]+)=(.*)$') {
|
||||
[System.Environment]::SetEnvironmentVariable($Matches[1], $Matches[2])
|
||||
}
|
||||
}
|
||||
|
||||
# Export only changed/new variables to GitHub Actions
|
||||
$count = 0
|
||||
Get-ChildItem env: | ForEach-Object {
|
||||
if ($before[$_.Name] -ne $_.Value) {
|
||||
"$($_.Name)=$($_.Value)" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
|
||||
$count++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Exported $count environment variables to GITHUB_ENV"
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# setup-sdl2.sh
|
||||
# Downloads/installs SDL2 for Windows and macOS.
|
||||
# Linux is handled separately via a Docker container.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
VERSION="${1:?Usage: setup-sdl2.sh <version>}"
|
||||
|
||||
case "$RUNNER_OS" in
|
||||
Windows)
|
||||
ARCHIVE="SDL2-devel-${VERSION}-VC.zip"
|
||||
URL="https://github.com/libsdl-org/SDL/releases/download/release-${VERSION}/${ARCHIVE}"
|
||||
DEST="${RUNNER_TEMP}/SDL2"
|
||||
|
||||
echo "Downloading SDL2 ${VERSION} (Windows/MSVC)..."
|
||||
curl -fsSL -o "${RUNNER_TEMP}/${ARCHIVE}" "${URL}"
|
||||
unzip -q "${RUNNER_TEMP}/${ARCHIVE}" -d "${DEST}"
|
||||
|
||||
SDL2_ROOT="${DEST}/SDL2-${VERSION}"
|
||||
echo "SDL2_ROOT=${SDL2_ROOT}" >> "${GITHUB_ENV}"
|
||||
;;
|
||||
|
||||
macOS)
|
||||
ARCHIVE="SDL2-${VERSION}.dmg"
|
||||
URL="https://github.com/libsdl-org/SDL/releases/download/release-${VERSION}/${ARCHIVE}"
|
||||
|
||||
echo "Downloading SDL2 ${VERSION} (macOS framework)..."
|
||||
curl -fsSL -o "${RUNNER_TEMP}/${ARCHIVE}" "${URL}"
|
||||
|
||||
hdiutil attach "${RUNNER_TEMP}/${ARCHIVE}" -quiet -mountpoint "${RUNNER_TEMP}/sdl2-mnt"
|
||||
sudo cp -R "${RUNNER_TEMP}/sdl2-mnt/SDL2.framework" /Library/Frameworks/
|
||||
hdiutil detach "${RUNNER_TEMP}/sdl2-mnt" -quiet
|
||||
;;
|
||||
|
||||
Linux)
|
||||
echo "Skipping — SDL2 is provided by the Docker container"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "::error::Unsupported RUNNER_OS: ${RUNNER_OS}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "SDL2 ${VERSION} setup complete for ${RUNNER_OS}"
|
||||
@@ -0,0 +1,17 @@
|
||||
name: 'Setup WASI SDK'
|
||||
inputs:
|
||||
python-version:
|
||||
description: 'Python version'
|
||||
default: '3.13'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
|
||||
- run: python3 -m pip install -r requirements.txt
|
||||
shell: bash
|
||||
@@ -0,0 +1,20 @@
|
||||
name: 'Setup WASI SDK'
|
||||
inputs:
|
||||
arch:
|
||||
description: 'OS / Architecture (ex: arm64-macos)'
|
||||
default: 'arm64-macos'
|
||||
version:
|
||||
description: 'SDK version'
|
||||
default: '25'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: Install WASI SDK
|
||||
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir /tmp/wasi-sdk
|
||||
curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ inputs.version }}/wasi-sdk-${{ inputs.version }}.0-${{ inputs.arch }}.tar.gz | tar xz --strip-components 1 -C /tmp/wasi-sdk
|
||||
sudo mv /tmp/wasi-sdk /opt/wasi-sdk
|
||||
Reference in New Issue
Block a user