diff --git a/.github/actions/build_companion/action.yml b/.github/actions/build_companion/action.yml index 101e92a59..71376118d 100644 --- a/.github/actions/build_companion/action.yml +++ b/.github/actions/build_companion/action.yml @@ -43,6 +43,12 @@ runs: shell: pwsh run: ${{ github.action_path }}/setup-msvc.ps1 + - name: Install NSIS + if: runner.os == 'Windows' + uses: repolevedavaj/install-nsis@v1.2.1 + with: + nsis-version: '3.11' + - name: Build shell: bash env: diff --git a/.github/workflows/companion.yml b/.github/workflows/companion.yml index 3cdde32d1..3ff175444 100644 --- a/.github/workflows/companion.yml +++ b/.github/workflows/companion.yml @@ -94,7 +94,9 @@ jobs: name: Linux Companion runs-on: ubuntu-latest needs: modules - if: inputs.target == 'all' || inputs.target == 'linux' || inputs.target == '' + if: | + (inputs.target == 'all' || inputs.target == 'linux' || inputs.target == '') && + (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-linux')) container: image: ghcr.io/edgetx/edgetx-dev:latest @@ -127,7 +129,9 @@ jobs: name: macOS Companion runs-on: macos-15 needs: modules - if: inputs.target == 'all' || inputs.target == 'macos' || inputs.target == '' + if: | + (inputs.target == 'all' || inputs.target == 'macos' || inputs.target == '') && + (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-macos')) env: CMAKE_OSX_ARCHITECTURES: 'x86_64;arm64' @@ -154,9 +158,11 @@ jobs: build-win64: name: Windows Companion - runs-on: windows-2022 + runs-on: windows-latest needs: modules - if: inputs.target == 'all' || inputs.target == 'windows' || inputs.target == '' + if: | + (inputs.target == 'all' || inputs.target == 'windows' || inputs.target == '') && + (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-win')) env: CMAKE_GENERATOR: 'Ninja' diff --git a/tools/build-companion.sh b/tools/build-companion.sh index d3c17ab5f..456d18209 100755 --- a/tools/build-companion.sh +++ b/tools/build-companion.sh @@ -52,10 +52,11 @@ if [[ -z ${EDGETX_VERSION_SUFFIX} ]]; then fi fi -rm -rf build && mkdir build && cd build +rm -rf build && mkdir build && cd build || exit get_platform_config() { - local platform=$(uname) + local platform + platform=$(uname) case "$platform" in "Darwin") PACKAGE_TARGET="package" @@ -116,13 +117,21 @@ elif ! cmake_build_parallel native --target ${PACKAGE_TARGET} >> "$LOG_FILE" 2>& echo " ❌ Packaging failed" cat "$LOG_FILE" error_status=1 -elif cp native/$PACKAGE_FILES "${OUTDIR}" 2>/dev/null; then - echo " ✅ Build completed successfully!" - echo " 📁 Package saved to: ${OUTDIR}" else - echo " ❌ Failed to copy package files to output directory" - ls -la native/ || echo "native/ directory not found" - error_status=1 + PACKAGE_FILE=$(find native/ -path "native/${PACKAGE_FILES}" -type f | head -n1) + if [ -n "$PACKAGE_FILE" ] && cp "$PACKAGE_FILE" "${OUTDIR}" 2>/dev/null; then + echo " ✅ Build completed successfully!" + echo " 📁 Package saved to: ${OUTDIR}" + echo " 📄 Copied: $(basename "$PACKAGE_FILE")" + else + echo " ❌ Failed to copy package files to output directory" + echo " 📁 Directory Contents:" + echo " ----------------------" + ls -la native/ || echo "native/ directory not found" + echo "Looking for files matching: $PACKAGE_FILES" + find native/ -path "native/${PACKAGE_FILES}" 2>/dev/null || echo "No matching files found" + error_status=1 + fi fi if [[ -n "$GITHUB_ACTIONS" ]]; then