Merge branch 'main' into feature/auto-update

This commit is contained in:
SoftFever
2026-01-05 00:33:58 +08:00
71 changed files with 907 additions and 384 deletions

View File

@@ -82,113 +82,109 @@ jobs:
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: ${{ github.event_name == 'schedule' }}
secrets: inherit
# TODO: Re-enable after auto-update testing is complete (depends on build_linux)
# unit_tests:
# name: Unit Tests
# runs-on: ubuntu-24.04
# needs: build_linux
# if: ${{ !cancelled() && success() }}
# steps:
# - name: Checkout
# uses: actions/checkout@v6
# with:
# sparse-checkout: |
# .github
# scripts
# tests
# - name: Apt-Install Dependencies
# uses: ./.github/actions/apt-install-deps
# - name: Restore Test Artifact
# uses: actions/download-artifact@v6
# with:
# name: ${{ github.sha }}-tests
# - uses: lukka/get-cmake@latest
# with:
# cmakeVersion: "~3.28.0" # use most recent 3.28.x version
# - name: Unpackage and Run Unit Tests
# timeout-minutes: 20
# run: |
# tar -xvf build_tests.tar
# scripts/run_unit_tests.sh
# - name: Upload Test Logs
# uses: actions/upload-artifact@v5
# if: ${{ failure() }}
# with:
# name: unit-test-logs
# path: build/tests/**/*.log
# - name: Publish Test Results
# if: always()
# uses: EnricoMi/publish-unit-test-result-action/linux@v2
# with:
# files: "ctest_results.xml"
# TODO: Re-enable after auto-update testing is complete
# flatpak:
# name: "Flatpak"
# container:
# image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
# options: --privileged
# volumes:
# - /usr/local/lib/android:/usr/local/lib/android
# - /usr/share/dotnet:/usr/share/dotnet
# - /opt/ghc:/opt/ghc1
# - /usr/local/share/boost:/usr/local/share/boost1
# - /opt/hostedtoolcache:/opt/hostedtoolcache1
# strategy:
# fail-fast: false
# matrix:
# variant:
# - arch: x86_64
# runner: ubuntu-24.04
# - arch: aarch64
# runner: ubuntu-24.04-arm
# # Don't run scheduled builds on forks:
# if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
# runs-on: ${{ matrix.variant.runner }}
# env:
# date:
# ver:
# ver_pure:
# steps:
# - name: "Remove unneeded stuff to free disk space"
# run:
# rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
# - uses: actions/checkout@v6
# - name: Get the version and date
# run: |
# ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
# if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# ver="PR-${{ github.event.number }}"
# git_commit_hash="${{ github.event.pull_request.head.sha }}"
# else
# ver=V$ver_pure
# git_commit_hash=""
# fi
# echo "ver=$ver" >> $GITHUB_ENV
# echo "ver_pure=$ver_pure" >> $GITHUB_ENV
# echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
# echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
# shell: bash
# - uses: flatpak/flatpak-github-actions/flatpak-builder@master
# with:
# bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
# manifest-path: scripts/flatpak/io.github.softfever.OrcaSlicer.yml
# cache: true
# arch: ${{ matrix.variant.arch }}
# upload-artifact: false
# - name: Upload artifacts Flatpak
# uses: actions/upload-artifact@v5
# 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'
# uses: WebFreak001/deploy-nightly@v3.2.0
# with:
# upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
# release_id: 137995723
# asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
# asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
# asset_content_type: application/octet-stream
# max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
unit_tests:
name: Unit Tests
runs-on: ubuntu-24.04
needs: build_linux
if: ${{ !cancelled() && success() }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: |
.github
scripts
tests
- name: Apt-Install Dependencies
uses: ./.github/actions/apt-install-deps
- name: Restore Test Artifact
uses: actions/download-artifact@v7
with:
name: ${{ github.sha }}-tests
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
- name: Unpackage and Run Unit Tests
timeout-minutes: 20
run: |
tar -xvf build_tests.tar
scripts/run_unit_tests.sh
- name: Upload Test Logs
uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: unit-test-logs
path: build/tests/**/*.log
- name: Publish Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action/linux@v2
with:
files: "ctest_results.xml"
flatpak:
name: "Flatpak"
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
- /opt/ghc:/opt/ghc1
- /usr/local/share/boost:/usr/local/share/boost1
- /opt/hostedtoolcache:/opt/hostedtoolcache1
strategy:
fail-fast: false
matrix:
variant:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
# Don't run scheduled builds on forks:
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
runs-on: ${{ matrix.variant.runner }}
env:
date:
ver:
ver_pure:
steps:
- name: "Remove unneeded stuff to free disk space"
run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
- uses: actions/checkout@v6
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"
else
ver=V$ver_pure
git_commit_hash=""
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
shell: bash
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: scripts/flatpak/io.github.softfever.OrcaSlicer.yml
cache: true
arch: ${{ matrix.variant.arch }}
upload-artifact: false
- name: Upload artifacts Flatpak
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'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted

View File

@@ -35,7 +35,7 @@ jobs:
# So building XOR cache loading.
# We use `lookup-only` to skip pulling cache.
- name: load cached deps
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
id: cache-load
with:
path: ${{ env.DEPS_PATH }}
@@ -97,7 +97,7 @@ jobs:
- name: Upload OrcaSlicer_dep director(ies) for use later
if: ${{ !cancelled() && ! env.ACT}}
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DEPS_PATH }}
@@ -106,7 +106,7 @@ jobs:
- name: Save cache from main branch
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && steps.cache-load.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: ${{ env.DEPS_PATH }}
key: ${{ steps.cache-load.outputs.cache-primary-key }}

View File

@@ -31,7 +31,7 @@ jobs:
lfs: 'true'
- name: Download deps artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.artifact-path }}
@@ -225,7 +225,7 @@ jobs:
- name: Upload artifacts mac
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_Mac_universal_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
@@ -240,7 +240,7 @@ jobs:
- name: Upload OrcaSlicer_profile_validator DMG mac
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
@@ -307,28 +307,28 @@ jobs:
- name: Upload artifacts Win zip
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/build/OrcaSlicer
- name: Upload artifacts Win installer
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_Windows_${{ env.ver }}
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
- name: Upload artifacts Win PDB
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: PDB
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
- name: Upload OrcaSlicer_profile_validator Win
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
@@ -388,7 +388,7 @@ jobs:
# and doesn't preserve file permissions
- name: Upload Test Artifact
if: inputs.os == 'ubuntu-24.04'
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: ${{ github.sha }}-tests
overwrite: true
@@ -410,7 +410,7 @@ jobs:
env:
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
@@ -419,7 +419,7 @@ jobs:
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
env:
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: './build/src/Release/OrcaSlicer_profile_validator'

78
.github/workflows/doxygen-docs.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: Generate Doxygen Documentation
on:
schedule:
- cron: '0 0 * * 1' # Every Monday at midnight UTC
workflow_dispatch: # Manual trigger
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-and-deploy:
name: Build and Deploy Docs
runs-on: ubuntu-latest
timeout-minutes: 60
# Only run on main branch of the main repository
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
permissions:
contents: read
steps:
- uses: thejerrybao/setup-swap-space@v1
with:
swap-space-path: /swapfile
swap-size-gb: 8
remove-existing-swap-files: true
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Doxygen and Graphviz
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Generate documentation
run: |
set -euo pipefail
# Override DOT_NUM_THREADS to avoid parallel dot race condition bug
sed -i 's/^DOT_NUM_THREADS.*/DOT_NUM_THREADS = 1/' .doxygen
doxygen .doxygen
# Verify documentation was generated
if [ ! -f "internal_docs/index.html" ]; then
echo "Error: Documentation generation failed - index.html not found"
exit 1
fi
- name: Install Rclone
run: |
set -euo pipefail
sudo -v
curl -fsSL https://rclone.org/install.sh | sudo bash
- name: optimize
run: |
set -euo pipefail
rm -f internal_docs/Nodes.xml internal_docs/Tokens.xml
find internal_docs -name "*.map" -type f -delete || true
find internal_docs -name "*.md5" -type f -delete || true
- name: upload
# We configure rclone dynamically using environment variables
run: |
set -euo pipefail
# Remove existing config if it exists to avoid conflicts
rclone config delete cloudflare 2>/dev/null || true
rclone config create cloudflare s3 \
provider Cloudflare \
access_key_id ${{ secrets.R2_ACCESS_KEY_ID }} \
secret_access_key ${{ secrets.R2_SECRET_ACCESS_KEY }} \
endpoint ${{ secrets.R2_ENDPOINT }}
rclone sync internal_docs/ cloudflare:orcaslicer-internals \
--progress \
--transfers 512 \
--checkers 512
echo "Documentation upload completed successfully"

View File

@@ -21,7 +21,7 @@ jobs:
steps:
- name: Cache shellcheck download
id: cache-shellcheck-v0_11
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/shellcheck
key: ${{ runner.os }}-shellcheck-v0_11