mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
* Fix missing force-build and use non-docker publish action Fixes #11687 Fixes #10404 * Initial deletion of build_check_cache Start to fold functionality into build_deps, but definitely broken. * Tests can be built separately Missed this before * Create artifact for all platforms, fix cache usage Cache is only created on `main` branch. Artifact is used to move files between jobs. The Linux artifact was broken, now it's not. The Mac artifact didn't exist, now it does. The Windows artifact gets a new name and now isn't a zip-within-a-zip. Perhaps this will cause a permissions problem; we will see shortly. * Apparently cannot update env used for `if` mid-stream * Force-build causes a clean deps build * Either build or pull from cache Cache only has final output, not intermediate files. So we either build or use the cache. * Keep dep uploads for 10 days instead It's just the final object outputs, not intermediates, so it's not as large and we can keep it slightly longer.
125 lines
5.2 KiB
YAML
125 lines
5.2 KiB
YAML
on:
|
|
workflow_call:
|
|
inputs:
|
|
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
|
|
runs-on: ${{ inputs.os }}
|
|
outputs:
|
|
artifact-name: ${{ env.ARTIFACT_NAME }}
|
|
artifact-path: ${{ env.DEPS_PATH }}
|
|
env:
|
|
DO_BUILD: ${{ inputs.build-deps-only || inputs.force-build }}
|
|
DEPS_PATH: ${{ github.workspace }}/deps/build${{ inputs.os != 'macos-14' && '/OrcaSlicer_dep' || '' }}
|
|
ARTIFACT_NAME: OrcaSlicer_dep_${{ inputs.os }}_${{ inputs.arch }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: 'true'
|
|
|
|
# Cached deps are just the final outputs, no intermediate files.
|
|
# So building XOR cache loading.
|
|
# We use `lookup-only` to skip pulling cache.
|
|
- name: load cached deps
|
|
uses: actions/cache/restore@v4
|
|
id: cache-load
|
|
with:
|
|
path: ${{ env.DEPS_PATH }}
|
|
key: ${{ inputs.os }}-${{ inputs.arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }}
|
|
lookup-only: ${{ env.DO_BUILD == 'true' }} # Doing this instead of `if` preserves the outputs of this step
|
|
|
|
- uses: lukka/get-cmake@latest
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') }}
|
|
with:
|
|
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
|
|
|
- name: setup dev on Windows
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Get the date on Ubuntu and macOS
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os != 'windows-latest' }}
|
|
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
|
shell: bash
|
|
|
|
- name: Get the date on Windows
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
|
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
|
shell: pwsh
|
|
|
|
- name: Build on Windows
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
choco install strawberryperl
|
|
.\build_release_vs.bat deps
|
|
|
|
# Windows and Linux don't need to delete any directories, because they only package up deps/build/OrcaSlicer_dep.
|
|
# But Mac has multiple and we're preserving their directory structure relationship.
|
|
# So the garbage siblings of OrcaSlicer_dep can be deleted to save artifact and cache space.
|
|
- name: Build on Mac ${{ inputs.arch }}
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && 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: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'ubuntu-24.04' }}
|
|
uses: ./.github/actions/apt-install-deps
|
|
|
|
- name: Build on Ubuntu
|
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
./build_linux.sh -dr
|
|
|
|
- name: Upload OrcaSlicer_dep director(ies) for use later
|
|
if: ${{ !cancelled() && ! env.ACT}}
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: ${{ env.ARTIFACT_NAME }}
|
|
path: ${{ env.DEPS_PATH }}
|
|
retention-days: 10 # It's not too big, but we don't need it for a very long time.
|
|
if-no-files-found: error
|
|
|
|
- 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
|
|
with:
|
|
path: ${{ env.DEPS_PATH }}
|
|
key: ${{ steps.cache-load.outputs.cache-primary-key }}
|
|
|
|
build_orca:
|
|
name: Build OrcaSlicer
|
|
needs: [build_deps]
|
|
if: ${{ !cancelled() && (!inputs.build-deps-only || inputs.force-build) }}
|
|
uses: ./.github/workflows/build_orca.yml
|
|
with:
|
|
artifact-name: ${{ needs.build_deps.outputs.artifact-name }}
|
|
artifact-path: ${{ needs.build_deps.outputs.artifact-path }}
|
|
os: ${{ inputs.os }}
|
|
arch: ${{ inputs.arch }}
|
|
secrets: inherit
|