on: workflow_call: inputs: cache-key: required: true type: string cache-path: required: true type: string valid-cache: required: true type: boolean os: required: true type: string arch: required: false type: string build-deps-only: required: false type: boolean force-build: required: false type: boolean jobs: build_deps: name: Build Deps if: ${{ !cancelled() && (inputs.build-deps-only || inputs.force-build || inputs.valid-cache != true) }} runs-on: ${{ inputs.os }} env: date: steps: # Setup the environment - name: Checkout uses: actions/checkout@v5 with: lfs: 'true' - name: load cached deps uses: actions/cache@v4 with: path: ${{ inputs.cache-path }} key: ${{ inputs.cache-key }} - uses: lukka/get-cmake@latest with: cmakeVersion: "~3.28.0" # use most recent 3.28.x version - name: setup dev on Windows if: inputs.os == 'windows-latest' uses: microsoft/setup-msbuild@v2 - name: Get the date on Ubuntu and macOS if: inputs.os != 'windows-latest' run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV shell: bash - name: Get the date on Windows if: inputs.os == 'windows-latest' run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 shell: pwsh # Build Dependencies - name: Build on Windows if: inputs.os == 'windows-latest' working-directory: ${{ github.workspace }} run: | choco install strawberryperl .\build_release_vs.bat deps .\build_release_vs.bat pack cd ${{ github.workspace }}/deps/build - name: Build on Mac ${{ inputs.arch }} if: inputs.os == 'macos-14' working-directory: ${{ github.workspace }} run: | brew install automake texinfo libtool brew list brew uninstall --ignore-dependencies zstd ./build_release_macos.sh -dx -a universal -t 10.15 -1 for arch in arm64 x86_64; do (cd "${{ github.workspace }}/deps/build/${arch}" && \ find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +) done brew install zstd - name: Apt-Install Dependencies if: inputs.os == 'ubuntu-24.04' uses: ./.github/actions/apt-install-deps - name: Build on Ubuntu if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' working-directory: ${{ github.workspace }} run: | mkdir -p ${{ github.workspace }}/deps/build/destdir ./build_linux.sh -dr cd deps/build tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir # Upload Artifacts # - name: Upload Mac ${{ inputs.arch }} artifacts # if: inputs.os == 'macos-14' # uses: actions/upload-artifact@v5 # with: # name: OrcaSlicer_dep_mac_${{ env.date }} # path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz - name: Upload Windows artifacts if: inputs.os == 'windows-latest' uses: actions/upload-artifact@v5 with: name: OrcaSlicer_dep_win64_${{ env.date }} path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip - name: Upload Ubuntu artifacts 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 with: name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz build_orca: name: Build OrcaSlicer needs: [build_deps] if: ${{ !cancelled() && !inputs.build-deps-only && (inputs.force-build || (inputs.valid-cache == true && needs.build_deps.result == 'skipped') || (inputs.valid-cache != true && success())) }} uses: ./.github/workflows/build_orca.yml with: cache-key: ${{ inputs.cache-key }} cache-path: ${{ inputs.cache-path }} os: ${{ inputs.os }} arch: ${{ inputs.arch }} secrets: inherit