From 2fe3d80a81c39156146cca87818ad131b75ba241 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Thu, 19 Mar 2026 12:04:22 +0800 Subject: [PATCH] fix errors --- .github/workflows/build_all.yml | 27 ++++++++++++++++++++------- .github/workflows/build_orca.yml | 4 ++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 51b54dd9ab..62454b34e2 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -152,20 +152,29 @@ jobs: self-hosted-runner: orca-lnx-server - arch: aarch64 runner: ubuntu-24.04-arm - # Don't run scheduled builds on forks; skip aarch64 on self-hosted (no ARM runner) - if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') && (!vars.SELF_HOSTED || matrix.variant.self-hosted-runner) }} - runs-on: ${{ vars.SELF_HOSTED && matrix.variant.self-hosted-runner || matrix.variant.runner }} + # Don't run scheduled builds on forks + if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }} + # When SELF_HOSTED is set, use self-hosted runner if available, otherwise fall back to + # cheapest GitHub runner (variant will be skipped via step conditions anyway) + runs-on: ${{ vars.SELF_HOSTED && (matrix.variant.self-hosted-runner || 'ubuntu-24.04') || matrix.variant.runner }} env: date: ver: ver_pure: steps: + - name: Check if variant should run + id: should-run + run: echo "skip=true" >> $GITHUB_OUTPUT + shell: bash + if: ${{ vars.SELF_HOSTED && !matrix.variant.self-hosted-runner }} - name: "Remove unneeded stuff to free disk space" - if: ${{ !vars.SELF_HOSTED }} + if: ${{ steps.should-run.outputs.skip != 'true' && !vars.SELF_HOSTED }} run: rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/* - uses: actions/checkout@v6 + if: ${{ steps.should-run.outputs.skip != 'true' }} - name: Get the version and date + if: ${{ steps.should-run.outputs.skip != 'true' }} run: | ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) if [[ "${{ github.event_name }}" == "pull_request" ]]; then @@ -182,30 +191,33 @@ jobs: shell: bash # Manage flatpak-builder cache externally so PRs restore but never upload - name: Restore flatpak-builder cache - if: github.event_name == 'pull_request' + if: ${{ steps.should-run.outputs.skip != 'true' && github.event_name == 'pull_request' }} uses: actions/cache/restore@v4 with: path: .flatpak-builder key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }} restore-keys: flatpak-builder-${{ matrix.variant.arch }}- - name: Save/restore flatpak-builder cache - if: github.event_name != 'pull_request' + if: ${{ steps.should-run.outputs.skip != 'true' && github.event_name != 'pull_request' }} uses: actions/cache@v4 with: path: .flatpak-builder key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }} restore-keys: flatpak-builder-${{ matrix.variant.arch }}- - name: Disable debug info for faster CI builds + if: ${{ steps.should-run.outputs.skip != 'true' }} run: | sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \ scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml shell: bash - name: Inject git commit hash into Flatpak manifest + if: ${{ steps.should-run.outputs.skip != 'true' }} run: | sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \ scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml shell: bash - uses: flatpak/flatpak-github-actions/flatpak-builder@master + if: ${{ steps.should-run.outputs.skip != 'true' }} with: bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak manifest-path: scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml @@ -213,12 +225,13 @@ jobs: arch: ${{ matrix.variant.arch }} upload-artifact: false - name: Upload artifacts Flatpak + if: ${{ steps.should-run.outputs.skip != 'true' }} uses: actions/upload-artifact@v6 with: name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak' - name: Deploy Flatpak to nightly release - if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && !vars.SELF_HOSTED + if: ${{ steps.should-run.outputs.skip != 'true' && github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && !vars.SELF_HOSTED }} uses: WebFreak001/deploy-nightly@v3.2.0 with: upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label} diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index bc43fc0b86..9501d5bc94 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -297,7 +297,7 @@ jobs: run: .\build_release_vs.bat slicer - name: Create installer Win - if: runner.os == 'Windows' + if: runner.os == 'Windows' && !vars.SELF_HOSTED working-directory: ${{ github.workspace }}/build run: | cpack -G NSIS @@ -322,7 +322,7 @@ jobs: path: ${{ github.workspace }}/build/OrcaSlicer - name: Upload artifacts Win installer - if: runner.os == 'Windows' + if: runner.os == 'Windows' && !vars.SELF_HOSTED uses: actions/upload-artifact@v6 with: name: OrcaSlicer_Windows_${{ env.ver }}