From 0cd3030c53cc6b3dee2a7f89619b7e8d96dd336c Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 27 Jul 2025 00:13:30 +0800 Subject: [PATCH] include OrcaSlicer_profile_validator in nightly build (#10233) * include OrcaSlicer_profile_validator in nightly build * build OrcaSlicer_profile_validator on Win * create dmg --- .github/workflows/build_orca.yml | 102 +++++++++++++++++++++++++++++++ build_release_macos.sh | 30 +++++++++ build_release_vs2022.bat | 2 +- src/CMakeLists.txt | 15 ++++- 4 files changed, 147 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 1ae30f7b3b..0753a65892 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -119,12 +119,35 @@ jobs: 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/universal/OrcaSlicer/OrcaSlicer.app + # Sign OrcaSlicer_profile_validator.app if it exists + if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app + fi + + # Create main OrcaSlicer DMG ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer/Applications hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_universal_${{ env.ver }}.dmg + + # Create separate OrcaSlicer_profile_validator DMG if the app exists + if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then + mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg + cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/ + ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications + hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + fi + + # Notarize main 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_universal_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait xcrun stapler staple OrcaSlicer_Mac_universal_${{ env.ver }}.dmg + + # Notarize profile validator DMG if it exists + if [ -f "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" ]; then + xcrun notarytool submit "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait + xcrun stapler staple OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + fi - name: Create DMG without notary if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' @@ -132,6 +155,14 @@ jobs: run: | ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer/Applications hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg + + # Create separate OrcaSlicer_profile_validator DMG if the app exists + if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then + mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg + cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/ + ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications + hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + fi - name: Upload artifacts mac if: inputs.os == 'macos-14' @@ -140,6 +171,14 @@ jobs: name: OrcaSlicer_Mac_universal_${{ env.ver }} path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg + - name: Upload OrcaSlicer_profile_validator DMG mac + if: inputs.os == 'macos-14' + uses: actions/upload-artifact@v4 + with: + name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }} + path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + if-no-files-found: ignore + - name: Deploy Mac release if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14' uses: WebFreak001/deploy-nightly@v3.2.0 @@ -151,6 +190,29 @@ jobs: 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 Mac OrcaSlicer_profile_validator release + if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14' + uses: WebFreak001/deploy-nightly@v3.2.0 + with: + upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} + release_id: 137995723 + asset_path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_${{ env.ver }}.zip + asset_name: OrcaSlicer_profile_validator_Mac_${{ env.ver }}.zip + asset_content_type: application/zip + max_releases: 1 + + - name: Deploy Mac OrcaSlicer_profile_validator DMG release + if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14' + uses: WebFreak001/deploy-nightly@v3.2.0 + with: + upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} + release_id: 137995723 + asset_path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + asset_name: OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg + asset_content_type: application/octet-stream + max_releases: 1 + # Windows - name: setup MSVC if: inputs.os == 'windows-latest' @@ -209,6 +271,13 @@ jobs: 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@v4 + with: + name: OrcaSlicer_profile_validator_Windows_${{ env.ver }} + path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe + - name: Deploy Windows release portable if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest' uses: WebFreak001/deploy-nightly@v3.2.0 @@ -231,6 +300,17 @@ jobs: asset_content_type: application/x-msdownload max_releases: 1 + - name: Deploy Windows OrcaSlicer_profile_validator release + if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest' + uses: WebFreak001/deploy-nightly@v3.2.0 + with: + upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} + release_id: 137995723 + asset_path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe + asset_name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}.exe + asset_content_type: application/x-msdownload + max_releases: 1 + # Ubuntu - name: Install dependencies if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' @@ -285,6 +365,15 @@ jobs: name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }} path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage' + - name: Upload OrcaSlicer_profile_validator Ubuntu + 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@v4 + with: + name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }} + path: './build/src/OrcaSlicer_profile_validator' + - name: Deploy Ubuntu release if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }} env: @@ -306,6 +395,19 @@ jobs: force_push_tag: true message: "nightly-builds" + - name: Deploy Ubuntu OrcaSlicer_profile_validator release + if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }} + env: + ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }} + uses: WebFreak001/deploy-nightly@v3.2.0 + with: + upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} + release_id: 137995723 + asset_path: ./build/src/OrcaSlicer_profile_validator + asset_name: OrcaSlicer_profile_validator_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }} + asset_content_type: application/octet-stream + max_releases: 1 + - name: Deploy orca_custom_preset_tests if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04' }} uses: WebFreak001/deploy-nightly@v3.2.0 diff --git a/build_release_macos.sh b/build_release_macos.sh index 95d06833f9..3f22dd99ee 100755 --- a/build_release_macos.sh +++ b/build_release_macos.sh @@ -177,6 +177,7 @@ function build_slicer() { cmake "${PROJECT_DIR}" \ -G "${SLICER_CMAKE_GENERATOR}" \ -DBBL_RELEASE_TO_PUBLIC=1 \ + -DORCA_TOOLS=ON \ -DCMAKE_PREFIX_PATH="$DEPS/usr/local" \ -DCMAKE_INSTALL_PREFIX="$PWD/OrcaSlicer" \ -DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \ @@ -210,6 +211,15 @@ function build_slicer() { cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources # delete .DS_Store file find ./OrcaSlicer.app/ -name '.DS_Store' -delete + + # Copy OrcaSlicer_profile_validator.app if it exists + if [ -f "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then + echo "Copying OrcaSlicer_profile_validator.app..." + rm -rf ./OrcaSlicer_profile_validator.app + cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app + # delete .DS_Store file + find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete + fi ) # extract version @@ -250,6 +260,26 @@ function build_universal() { -output "$UNIVERSAL_APP/$BINARY_PATH" echo "Universal binary created at $UNIVERSAL_APP" + + # Create universal binary for profile validator if it exists + if [ -f "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ] && \ + [ -f "$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then + echo "Creating universal binary for OrcaSlicer_profile_validator..." + UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app" + rm -rf "$UNIVERSAL_VALIDATOR_APP" + cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app" "$UNIVERSAL_VALIDATOR_APP" + + # Get the binary path inside the profile validator .app bundle + VALIDATOR_BINARY_PATH="Contents/MacOS/OrcaSlicer_profile_validator" + + # Create universal binary using lipo + lipo -create \ + "$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \ + "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \ + -output "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH" + + echo "Universal binary for OrcaSlicer_profile_validator created at $UNIVERSAL_VALIDATOR_APP" + fi } case "${BUILD_TARGET}" in diff --git a/build_release_vs2022.bat b/build_release_vs2022.bat index d4a26da99a..715b534ec4 100644 --- a/build_release_vs2022.bat +++ b/build_release_vs2022.bat @@ -58,7 +58,7 @@ mkdir %build_dir% cd %build_dir% echo on -cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" +cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DORCA_TOOLS=ON -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" cmake --build . --config %build_type% --target ALL_BUILD -- -m @echo off cd .. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60259d3704..e3c2fe0c39 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -97,7 +97,20 @@ endif() if(ORCA_TOOLS) # OrcaSlicer_profile_validator - add_executable(OrcaSlicer_profile_validator OrcaSlicer_profile_validator.cpp) + if(APPLE) + add_executable(OrcaSlicer_profile_validator MACOSX_BUNDLE OrcaSlicer_profile_validator.cpp) + set_target_properties(OrcaSlicer_profile_validator PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_BUNDLE_NAME "OrcaSlicer Profile Validator" + MACOSX_BUNDLE_BUNDLE_VERSION "${SLIC3R_VERSION}" + MACOSX_BUNDLE_SHORT_VERSION_STRING "${SLIC3R_VERSION}" + MACOSX_BUNDLE_IDENTIFIER "com.softfever.orcaslicer.profile-validator" + MACOSX_BUNDLE_COPYRIGHT "© 2024 SoftFever" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.softfever.orcaslicer.profile-validator" + ) + else() + add_executable(OrcaSlicer_profile_validator OrcaSlicer_profile_validator.cpp) + endif() target_link_libraries(OrcaSlicer_profile_validator libslic3r boost_headeronly libcurl OpenSSL::SSL OpenSSL::Crypto) target_compile_definitions(OrcaSlicer_profile_validator PRIVATE -DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8) if(WIN32)