2023-06-07 06:50:19 +00:00
|
|
|
on:
|
2023-11-18 07:30:06 +00:00
|
|
|
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
|
2023-08-20 12:02:54 +00:00
|
|
|
|
2023-06-07 06:50:19 +00:00
|
|
|
jobs:
|
2023-06-08 08:42:42 +00:00
|
|
|
build_deps:
|
2023-11-18 07:30:06 +00:00
|
|
|
name: Build Deps
|
|
|
|
if: inputs.build-deps-only || inputs.valid-cache != true
|
|
|
|
runs-on: ${{ inputs.os }}
|
|
|
|
env:
|
|
|
|
date:
|
2023-06-07 06:50:19 +00:00
|
|
|
steps:
|
2024-04-16 12:14:09 +00:00
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
# Setup the environment
|
2023-06-07 07:13:02 +00:00
|
|
|
- name: Checkout
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-03-11 15:01:42 +00:00
|
|
|
with:
|
|
|
|
lfs: 'true'
|
2024-04-16 12:14:09 +00:00
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
- name: load cached deps
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: actions/cache@v4
|
2023-11-18 07:30:06 +00:00
|
|
|
with:
|
|
|
|
path: ${{ inputs.cache-path }}
|
|
|
|
key: ${{ inputs.cache-key }}
|
2023-06-07 06:50:19 +00:00
|
|
|
|
2024-07-16 14:37:28 +00:00
|
|
|
- uses: lukka/get-cmake@latest
|
|
|
|
with:
|
|
|
|
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
|
|
|
|
2023-06-07 07:42:18 +00:00
|
|
|
- name: setup dev on Windows
|
2023-11-18 07:30:06 +00:00
|
|
|
if: inputs.os == 'windows-latest'
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
2023-06-07 07:42:18 +00:00
|
|
|
|
2023-08-06 10:24:49 +00:00
|
|
|
- name: Get the date on Ubuntu and macOS
|
2023-11-18 07:30:06 +00:00
|
|
|
if: inputs.os != 'windows-latest'
|
2023-08-06 10:24:49 +00:00
|
|
|
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
|
|
|
shell: bash
|
2024-04-16 12:14:09 +00:00
|
|
|
|
2023-08-06 10:24:49 +00:00
|
|
|
- name: Get the date on Windows
|
2023-11-18 07:30:06 +00:00
|
|
|
if: inputs.os == 'windows-latest'
|
2023-08-06 10:24:49 +00:00
|
|
|
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
|
|
|
shell: pwsh
|
|
|
|
|
2024-04-16 12:14:09 +00:00
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
# Build Dependencies
|
2023-06-07 07:13:02 +00:00
|
|
|
- name: Build on Windows
|
2023-11-18 07:30:06 +00:00
|
|
|
if: inputs.os == 'windows-latest'
|
2023-06-07 07:13:02 +00:00
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
choco install strawberryperl
|
2023-08-20 12:02:54 +00:00
|
|
|
.\build_release_vs2022.bat deps
|
2023-10-08 16:19:26 +00:00
|
|
|
.\build_release_vs2022.bat pack
|
2023-08-06 10:24:49 +00:00
|
|
|
cd ${{ github.workspace }}/deps/build
|
2023-06-07 06:50:19 +00:00
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
- name: Build on Mac ${{ inputs.arch }}
|
2024-06-25 15:24:39 +00:00
|
|
|
if: inputs.os == 'macos-14'
|
2023-06-07 07:13:02 +00:00
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
2024-06-25 15:24:39 +00:00
|
|
|
brew install automake texinfo ninja libtool
|
2023-11-18 07:30:06 +00:00
|
|
|
brew list
|
|
|
|
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
|
|
|
|
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
|
2023-12-27 07:43:05 +00:00
|
|
|
brew uninstall --ignore-dependencies zstd
|
2024-06-25 15:24:39 +00:00
|
|
|
./build_release_macos.sh -dpx -a ${{ inputs.arch }} -t 10.15 -1
|
2023-12-27 07:43:05 +00:00
|
|
|
brew install zstd
|
|
|
|
|
2023-06-07 09:44:48 +00:00
|
|
|
|
2024-07-01 15:44:49 +00:00
|
|
|
- name: Install Ubuntu Build Dependencies
|
|
|
|
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
2023-06-07 07:13:02 +00:00
|
|
|
working-directory: ${{ github.workspace }}
|
2024-07-01 15:44:49 +00:00
|
|
|
env:
|
|
|
|
apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }}
|
|
|
|
webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }}
|
2023-06-07 07:13:02 +00:00
|
|
|
run: |
|
2024-07-01 15:44:49 +00:00
|
|
|
${{ env.apt-cmd }} update
|
|
|
|
${{ env.apt-cmd }} install -y cmake git g++ build-essential libgl1-mesa-dev m4 \
|
2023-06-08 08:42:42 +00:00
|
|
|
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \
|
2024-07-01 15:44:49 +00:00
|
|
|
libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-${{ env.webkit-ver }}-dev \
|
2023-06-08 08:42:42 +00:00
|
|
|
libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \
|
2024-01-03 22:50:11 +00:00
|
|
|
gstreamer1.0-plugins-bad libosmesa6-dev wget sudo autoconf curl libunwind-dev texinfo
|
2024-07-01 15:44:49 +00:00
|
|
|
|
|
|
|
- name: Build on Ubuntu
|
|
|
|
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
2023-06-07 07:13:02 +00:00
|
|
|
mkdir -p ${{ github.workspace }}/deps/build
|
|
|
|
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
|
|
|
sudo ./BuildLinux.sh -ur
|
|
|
|
sudo chown $USER -R ./
|
2023-08-06 10:24:49 +00:00
|
|
|
./BuildLinux.sh -dr
|
2023-10-08 16:19:26 +00:00
|
|
|
cd deps/build
|
|
|
|
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
2024-04-16 12:14:09 +00:00
|
|
|
|
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
# Upload Artifacts
|
|
|
|
- name: Upload Mac ${{ inputs.arch }} artifacts
|
2024-06-25 15:24:39 +00:00
|
|
|
if: inputs.os == 'macos-14'
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-06 10:24:49 +00:00
|
|
|
with:
|
2023-11-18 07:30:06 +00:00
|
|
|
name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}
|
|
|
|
path: ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep*.tar.gz
|
2023-08-06 10:24:49 +00:00
|
|
|
|
|
|
|
- name: Upload Windows artifacts
|
2023-11-18 07:30:06 +00:00
|
|
|
if: inputs.os == 'windows-latest'
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-06 10:24:49 +00:00
|
|
|
with:
|
|
|
|
name: OrcaSlicer_dep_win64_${{ env.date }}
|
2023-10-08 16:19:26 +00:00
|
|
|
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
2023-08-06 10:24:49 +00:00
|
|
|
|
|
|
|
- name: Upload Ubuntu artifacts
|
2024-07-01 15:44:49 +00:00
|
|
|
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') || '' }}
|
2024-03-10 14:45:35 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-06 10:24:49 +00:00
|
|
|
with:
|
2024-07-01 15:44:49 +00:00
|
|
|
name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
2023-10-08 16:19:26 +00:00
|
|
|
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
2024-04-16 12:14:09 +00:00
|
|
|
|
2023-11-18 07:30:06 +00:00
|
|
|
build_orca:
|
|
|
|
name: Build OrcaSlicer
|
|
|
|
needs: [build_deps]
|
|
|
|
if: ${{ !cancelled() && !inputs.build-deps-only && (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 }}
|
2023-11-19 03:23:36 +00:00
|
|
|
secrets: inherit
|