ci: create github actions workflow
JIRA: STUDIO-6329 Change-Id: I31ef884af8e95d867a01b3aacbfeaef533600c34 (cherry picked from commit db5b53424e122ac4c40a5d96baacaee7f62d1e2f)
This commit is contained in:
parent
e2735f1474
commit
4707cfb986
|
@ -0,0 +1,55 @@
|
||||||
|
name: Build all
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'deps/**'
|
||||||
|
- 'src/**'
|
||||||
|
- '**/CMakeLists.txt'
|
||||||
|
- 'version.inc'
|
||||||
|
- 'bbl/**'
|
||||||
|
- 'resources/**'
|
||||||
|
- ".github/workflows/build_*.yml"
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'deps/**'
|
||||||
|
- 'src/**'
|
||||||
|
- '**/CMakeLists.txt'
|
||||||
|
- 'version.inc'
|
||||||
|
- ".github/workflows/build_*.yml"
|
||||||
|
- 'BuildLinux.sh'
|
||||||
|
- 'build_win.bat'
|
||||||
|
|
||||||
|
workflow_dispatch: # manual dispatch
|
||||||
|
inputs:
|
||||||
|
build-deps-only:
|
||||||
|
description: 'Only build dependencies (bypasses caching)'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_all:
|
||||||
|
name: Build All
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
- os: windows-latest
|
||||||
|
- os: macos-13
|
||||||
|
arch: x86_64
|
||||||
|
uses: ./.github/workflows/build_check_cache.yml
|
||||||
|
with:
|
||||||
|
os: ${{ matrix.os }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||||
|
secrets: inherit
|
|
@ -0,0 +1,287 @@
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
cache-key:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
cache-path:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
arch:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_bambu:
|
||||||
|
name: Build BambuStudio
|
||||||
|
runs-on: ${{ inputs.os }}
|
||||||
|
env:
|
||||||
|
date:
|
||||||
|
ver:
|
||||||
|
ver_pure:
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: 'true'
|
||||||
|
|
||||||
|
- name: load cached deps
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.cache-path }}
|
||||||
|
key: ${{ inputs.cache-key }}
|
||||||
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
|
- name: Get the version and date on Ubuntu and macOS
|
||||||
|
if: inputs.os != 'windows-latest'
|
||||||
|
run: |
|
||||||
|
ver_pure=$(grep 'set(SLIC3R_VERSION' version.inc | cut -d '"' -f2)
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
ver="PR-${{ github.event.number }}"
|
||||||
|
else
|
||||||
|
ver=V$ver_pure
|
||||||
|
fi
|
||||||
|
echo "ver=$ver" >> $GITHUB_ENV
|
||||||
|
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||||
|
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Get the version and date on Windows
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
$date = Get-Date -Format 'yyyyMMdd'
|
||||||
|
$ref = "${{ github.ref }}"
|
||||||
|
$eventName = "${{ github.event_name }}"
|
||||||
|
$prNumber = "${{ github.event.number }}"
|
||||||
|
|
||||||
|
if ($eventName -eq 'pull_request') {
|
||||||
|
$ver = "PR" + $prNumber
|
||||||
|
} else {
|
||||||
|
$versionContent = Get-Content version.inc -Raw
|
||||||
|
if ($versionContent -match 'set\(SLIC3R_VERSION "(.*?)"\)') {
|
||||||
|
$ver = $matches[1]
|
||||||
|
}
|
||||||
|
$ver = "V$ver"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||||
|
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||||
|
echo "date: ${{ env.date }} version: ${{ env.ver }}"
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
# Mac
|
||||||
|
- name: Build slicer mac
|
||||||
|
if: inputs.os == 'macos-13'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
brew install cmake git gettext automake texinfo
|
||||||
|
mkdir -p ${{ github.workspace }}/build_${{inputs.arch}}
|
||||||
|
cd ${{ github.workspace }}/build_${{inputs.arch}}
|
||||||
|
cmake .. -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="${{ github.workspace }}/deps/build_${{ inputs.arch }}/BambuStudio_dep_${{ inputs.arch }}/usr/local" -DCMAKE_INSTALL_PREFIX="../install_dir" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="${{ github.workspace }}/deps/build_${{ inputs.arch }}/BambuStudio_dep_${{ inputs.arch }}/usr/local" -DCMAKE_MACOSX_BUNDLE=on
|
||||||
|
cmake --build . --target install --config Release -j4
|
||||||
|
|
||||||
|
# Thanks to RaySajuuk, it's working now
|
||||||
|
# - name: Sign app and notary
|
||||||
|
# if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-13'
|
||||||
|
# working-directory: ${{ github.workspace }}
|
||||||
|
# env:
|
||||||
|
# BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||||
|
# P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||||
|
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||||
|
# CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }}
|
||||||
|
# run: |
|
||||||
|
# CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||||
|
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||||
|
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
|
||||||
|
# security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||||
|
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||||
|
# security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||||
|
# security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||||
|
# security list-keychain -d user -s $KEYCHAIN_PATH
|
||||||
|
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH
|
||||||
|
# codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/OrcaSlicer.app
|
||||||
|
# ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
|
||||||
|
# hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||||
|
# codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||||
|
# xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}"
|
||||||
|
# xcrun notarytool submit "OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
|
||||||
|
# xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||||
|
|
||||||
|
# - name: Create DMG without notary
|
||||||
|
# if: github.ref != 'refs/heads/main' && inputs.os == 'macos-13'
|
||||||
|
# working-directory: ${{ github.workspace }}
|
||||||
|
# run: |
|
||||||
|
# ls ${{ github.workspace }}/install_dir
|
||||||
|
# brew install create-dmg
|
||||||
|
# create-dmg --volname "Bambu Studio" --window-pos 200 120 --window-size 600 400 --icon-size 100 --icon "BambuStudio.app" 200 150 --app-drop-link 400 150 BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}.dmg ${{ github.workspace }}/install_dir/
|
||||||
|
|
||||||
|
- name: pack mac app
|
||||||
|
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-13'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: zip -r BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}.zip ${{ github.workspace }}/install_dir
|
||||||
|
|
||||||
|
- name: Upload artifacts mac
|
||||||
|
if: inputs.os == 'macos-13'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}
|
||||||
|
path: ${{ github.workspace }}/BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}.zip
|
||||||
|
|
||||||
|
# - name: Deploy Mac release
|
||||||
|
# if: github.ref == 'refs/heads/main' && inputs.os == 'macos-13'
|
||||||
|
# uses: WebFreak001/deploy-nightly@v3.1.0
|
||||||
|
# with:
|
||||||
|
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||||
|
# release_id: 137995723
|
||||||
|
# asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||||
|
# asset_name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
- name: setup MSVC
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
|
- name: Install nsis and pkgconfig
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
dir "C:/Program Files (x86)/Windows Kits/10/Include"
|
||||||
|
choco install nsis
|
||||||
|
|
||||||
|
- name: Build slicer Win
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -G "Visual Studio 17 2022" -A X64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="${{ github.workspace }}\deps\build\BambuStudio_dep\usr\local" -DCMAKE_INSTALL_PREFIX="../install-dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
|
||||||
|
cmake --build . --target install --config Release -- -m
|
||||||
|
|
||||||
|
# - name: Create installer Win
|
||||||
|
# if: inputs.os == 'windows-latest'
|
||||||
|
# working-directory: ${{ github.workspace }}/build
|
||||||
|
# run: |
|
||||||
|
# cpack -G NSIS
|
||||||
|
|
||||||
|
- name: Pack app
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
shell: cmd
|
||||||
|
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip BambuStudio_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/install-dir'
|
||||||
|
|
||||||
|
# - name: Pack PDB
|
||||||
|
# if: inputs.os == 'windows-latest'
|
||||||
|
# working-directory: ${{ github.workspace }}/build/src/Release
|
||||||
|
# shell: cmd
|
||||||
|
# run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
|
||||||
|
|
||||||
|
- name: Upload artifacts Win zip
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_Windows_${{ env.ver }}_portable
|
||||||
|
path: ${{ github.workspace }}/BambuStudio_Windows_${{ env.ver }}_portable.zip
|
||||||
|
|
||||||
|
# - name: Upload artifacts Win installer
|
||||||
|
# if: inputs.os == 'windows-latest'
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: BambuStudio_Windows_${{ env.ver }}
|
||||||
|
# path: ${{ github.workspace }}/build/BambuStudio*.exe
|
||||||
|
|
||||||
|
# - name: Upload artifacts Win PDB
|
||||||
|
# if: inputs.os == 'windows-latest'
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: PDB
|
||||||
|
# path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
|
||||||
|
|
||||||
|
# - name: Deploy Windows release portable
|
||||||
|
# if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||||
|
# uses: WebFreak001/deploy-nightly@v3.1.0
|
||||||
|
# with:
|
||||||
|
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||||
|
# release_id: 137995723
|
||||||
|
# asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||||
|
# asset_name: OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||||
|
# asset_content_type: application/x-zip-compressed
|
||||||
|
# max_releases: 1
|
||||||
|
|
||||||
|
# - name: Deploy Windows release installer
|
||||||
|
# if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
|
||||||
|
# uses: WebFreak001/deploy-nightly@v3.1.0
|
||||||
|
# with:
|
||||||
|
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||||
|
# release_id: 137995723
|
||||||
|
# asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||||
|
# asset_name: OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||||
|
# asset_content_type: application/x-msdownload
|
||||||
|
# max_releases: 1
|
||||||
|
|
||||||
|
# Ubuntu
|
||||||
|
- name: Install dependencies
|
||||||
|
if: inputs.os == 'ubuntu-20.04'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y autoconf build-essential cmake curl wget file git \
|
||||||
|
libgl1-mesa-dev libgtk-3-dev libxkbcommon-dev libunwind-dev libfuse2
|
||||||
|
|
||||||
|
- name: Install dependencies from BuildLinux.sh
|
||||||
|
if: inputs.os == 'ubuntu-20.04'
|
||||||
|
shell: bash
|
||||||
|
run: sudo ./BuildLinux.sh -ur
|
||||||
|
|
||||||
|
- name: Fix permissions
|
||||||
|
if: inputs.os == 'ubuntu-20.04'
|
||||||
|
shell: bash
|
||||||
|
run: sudo chown $USER -R ./
|
||||||
|
|
||||||
|
- name: Build slicer
|
||||||
|
if: inputs.os == 'ubuntu-20.04'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./BuildLinux.sh -isr
|
||||||
|
mv -n ./build/BambuStudio_ubu64.AppImage ./build/Bambu_Studio_linux_${{ env.ver }}.AppImage
|
||||||
|
|
||||||
|
# - name: Build orca_custom_preset_tests
|
||||||
|
# if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04'
|
||||||
|
# working-directory: ${{ github.workspace }}/build/src
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -g 1
|
||||||
|
# cd ${{ github.workspace }}/resources/profiles
|
||||||
|
# zip -r orca_custom_preset_tests.zip user/
|
||||||
|
|
||||||
|
- name: Upload artifacts Ubuntu
|
||||||
|
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_Linux_${{ env.ver }}
|
||||||
|
path: './build/Bambu_Studio_linux_${{ env.ver }}.AppImage'
|
||||||
|
|
||||||
|
# - name: Deploy Ubuntu release
|
||||||
|
# if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }}
|
||||||
|
# uses: WebFreak001/deploy-nightly@v3.1.0
|
||||||
|
# with:
|
||||||
|
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||||
|
# release_id: 137995723
|
||||||
|
# asset_path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
|
||||||
|
# asset_name: OrcaSlicer_Linux_${{ env.ver }}.AppImage
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# - name: Deploy orca_custom_preset_tests
|
||||||
|
# if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }}
|
||||||
|
# uses: WebFreak001/deploy-nightly@v3.1.0
|
||||||
|
# with:
|
||||||
|
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||||
|
# release_id: 137995723
|
||||||
|
# asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
|
||||||
|
# asset_name: orca_custom_preset_tests.zip
|
||||||
|
# asset_content_type: application/octet-stream
|
||||||
|
# max_releases: 1
|
|
@ -0,0 +1,60 @@
|
||||||
|
name: Check Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
arch:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
build-deps-only:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_cache: # determines if there is a cache and outputs variables used in caching process
|
||||||
|
name: Check Cache
|
||||||
|
runs-on: ${{ inputs.os }}
|
||||||
|
outputs:
|
||||||
|
cache-key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||||
|
cache-path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||||
|
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: 'true'
|
||||||
|
|
||||||
|
- name: set outputs
|
||||||
|
id: set_outputs
|
||||||
|
env:
|
||||||
|
underscore-arch: ${{ inputs.os == 'macos-13' && '_' || ''}}${{ inputs.os == 'macos-13' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
|
||||||
|
dash-arch: ${{ inputs.os == 'macos-13' && '-' || ''}}${{ inputs.os == 'macos-13' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
|
||||||
|
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-13') && 'BambuStudio_dep' || 'destdir' }}
|
||||||
|
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||||
|
run: |
|
||||||
|
echo cache-key=${{ runner.os }}${{ env.dash-arch }}-cache-bambustudio_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||||
|
echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}
|
||||||
|
|
||||||
|
- name: load cache
|
||||||
|
id: cache_deps
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||||
|
key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||||
|
lookup-only: true
|
||||||
|
|
||||||
|
build_deps: # call next step
|
||||||
|
name: Build Deps
|
||||||
|
needs: [check_cache]
|
||||||
|
uses: ./.github/workflows/build_deps.yml
|
||||||
|
with:
|
||||||
|
cache-key: ${{ needs.check_cache.outputs.cache-key }}
|
||||||
|
cache-path: ${{ needs.check_cache.outputs.cache-path }}
|
||||||
|
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
|
||||||
|
os: ${{ inputs.os }}
|
||||||
|
arch: ${{ inputs.arch }}
|
||||||
|
build-deps-only: ${{ inputs.build-deps-only }}
|
||||||
|
secrets: inherit
|
|
@ -0,0 +1,139 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_deps:
|
||||||
|
name: Build Deps
|
||||||
|
if: inputs.build-deps-only || inputs.valid-cache != true
|
||||||
|
runs-on: ${{ inputs.os }}
|
||||||
|
env:
|
||||||
|
date:
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# Setup the environment
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: 'true'
|
||||||
|
|
||||||
|
- name: load cached deps
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.cache-path }}
|
||||||
|
key: ${{ inputs.cache-key }}
|
||||||
|
|
||||||
|
- 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
|
||||||
|
mkdir ${{ github.workspace }}\deps\build
|
||||||
|
mkdir ${{ github.workspace }}\deps\build\BambuStudio_dep
|
||||||
|
cd "${{ github.workspace }}\deps\build"
|
||||||
|
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="./BambuStudio_dep" -DCMAKE_BUILD_TYPE=Release -DDEP_DEBUG=OFF
|
||||||
|
msbuild /m ALL_BUILD.vcxproj
|
||||||
|
|
||||||
|
- name: pack deps on Windows
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: Compress-Archive -Path "${{ github.workspace }}\deps\build\BambuStudio_dep\*" -DestinationPath "${{ github.workspace }}\deps\build\BambuStudio_dep_win64_${{ env.date }}_vs2022.zip"
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build on Mac ${{ inputs.arch }}
|
||||||
|
if: inputs.os == 'macos-13'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
brew install cmake git gettext automake texinfo
|
||||||
|
brew uninstall --ignore-dependencies zstd
|
||||||
|
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
|
||||||
|
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/BambuStudio_dep_${{ inputs.arch }}
|
||||||
|
cd ${{ github.workspace }}/deps/build_${{ inputs.arch }}
|
||||||
|
cmake ../ -DDESTDIR="${{ github.workspace }}/deps/build_${{ inputs.arch }}/BambuStudio_dep_${{ inputs.arch }}" -DOPENSSL_ARCH="darwin64-x86_64-cc"
|
||||||
|
make -j4
|
||||||
|
brew install zstd
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build on Ubuntu
|
||||||
|
if: inputs.os == 'ubuntu-20.04'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install cmake libgl1-mesa-dev libgtk-3-dev libxkbcommon-dev libunwind-dev libfuse2 -y
|
||||||
|
mkdir -p ${{ github.workspace }}/deps/build
|
||||||
|
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
||||||
|
sudo ./BuildLinux.sh -ur
|
||||||
|
sudo chown $USER -R ./
|
||||||
|
./BuildLinux.sh -dr
|
||||||
|
cd deps/build
|
||||||
|
tar -czvf BambuStudio_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
||||||
|
|
||||||
|
|
||||||
|
# Upload Artifacts
|
||||||
|
- name: Upload Mac ${{ inputs.arch }} artifacts
|
||||||
|
if: inputs.os == 'macos-13'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_dep_mac_${{ inputs.arch }}_${{ env.date }}
|
||||||
|
path: ${{ github.workspace }}/deps/build_${{ inputs.arch }}/BambuStudio_dep*.tar.gz
|
||||||
|
|
||||||
|
- name: Upload Windows artifacts
|
||||||
|
if: inputs.os == 'windows-latest'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_dep_win64_${{ env.date }}
|
||||||
|
path: ${{ github.workspace }}/deps/build/BambuStudio_dep*.zip
|
||||||
|
|
||||||
|
- name: Upload Ubuntu artifacts
|
||||||
|
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: BambuStudio_dep_ubuntu_${{ env.date }}
|
||||||
|
path: ${{ github.workspace }}/deps/build/BambuStudio_dep_ubuntu_*.tar.gz
|
||||||
|
|
||||||
|
build_Bambu:
|
||||||
|
name: Build BambuStudio
|
||||||
|
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_bambu.yml
|
||||||
|
with:
|
||||||
|
cache-key: ${{ inputs.cache-key }}
|
||||||
|
cache-path: ${{ inputs.cache-path }}
|
||||||
|
os: ${{ inputs.os }}
|
||||||
|
arch: ${{ inputs.arch }}
|
||||||
|
secrets: inherit
|
|
@ -112,6 +112,11 @@ if (MSVC)
|
||||||
add_compile_options(/wd4244 /wd4267)
|
add_compile_options(/wd4244 /wd4267)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# https://github.com/SoftFever/OrcaSlicer/issues/2233
|
||||||
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||||
|
add_compile_definitions(BOOST_NO_CXX98_FUNCTION_BASE _HAS_AUTO_PTR_ETC=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
add_compile_options(-Wa,-mbig-obj)
|
add_compile_options(-Wa,-mbig-obj)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -238,7 +238,8 @@ endif()
|
||||||
set(OpenVDB_LIB_COMPONENTS "")
|
set(OpenVDB_LIB_COMPONENTS "")
|
||||||
set(OpenVDB_DEBUG_SUFFIX "d" CACHE STRING "Suffix for the debug libraries")
|
set(OpenVDB_DEBUG_SUFFIX "d" CACHE STRING "Suffix for the debug libraries")
|
||||||
|
|
||||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
# get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
set(_is_multi FALSE)
|
||||||
|
|
||||||
foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||||
set(LIB_NAME ${COMPONENT})
|
set(LIB_NAME ${COMPONENT})
|
||||||
|
|
Loading…
Reference in New Issue