diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index 52220783d5..a54fb9f4b2 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -120,7 +120,7 @@ jobs: - name: Install MacOS system requirements if: ${{ runner.os == 'Macos' }} - run: brew install autoconf automake ninja create-dmg + run: brew install autoconf automake ninja - name: Install Linux system requirements if: ${{ runner.os == 'Linux' }} @@ -251,7 +251,7 @@ jobs: if "${{ runner.os }}" == "Windows": installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe" elif "${{ runner.os }}" == "macOS": - installer_ext = "dmg" + installer_ext = "pkg" else: installer_ext = "AppImage" output_env = os.environ["GITHUB_OUTPUT"] @@ -308,7 +308,7 @@ jobs: run: python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - - name: Create the MacOS dmg and/or pkg (Bash) + - name: Create the MacOS pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} run: python ../cura_inst/packaging/MacOs/build_macos.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist diff --git a/packaging/MacOs/build_macos.py b/packaging/MacOs/build_macos.py index ebb8216870..e3d64199c9 100644 --- a/packaging/MacOs/build_macos.py +++ b/packaging/MacOs/build_macos.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 UltiMaker +# Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. @@ -8,25 +8,6 @@ import subprocess ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura") - -def build_dmg(source_path: str, dist_path: str, filename: str) -> None: - create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg") - - arguments = [create_dmg_executable, - "--window-pos", "640", "360", - "--window-size", "690", "503", - "--app-drop-link", "520", "272", - "--volicon", f"{source_path}/packaging/icons/VolumeIcons_Cura.icns", - "--icon-size", "90", - "--icon", "UltiMaker-Cura.app", "169", "272", - "--eula", f"{source_path}/packaging/cura_license.txt", - "--background", f"{source_path}/packaging/MacOs/cura_background_dmg.png", - f"{dist_path}/{filename}", - f"{dist_path}/UltiMaker-Cura.app"] - - subprocess.run(arguments) - - def build_pkg(source_path: str, dist_path: str, app_filename: str, component_filename: str, installer_filename: str) -> None: """ Builds and signs the pkg installer. @@ -123,41 +104,17 @@ def create_pkg_installer(filename: str, dist_path: str, source_path: str) -> Non code_sign(dist_path, app_name) # The app is signed using a different certificate than the package files build_pkg(source_path, dist_path, app_name, cura_component_package_name, installer_package_name) - notarize = bool(os.environ.get("NOTARIZE_PKG", "TRUE")) + notarize = bool(os.environ.get("NOTARIZE_INSTALLER", "TRUE")) if notarize: notarize_file(dist_path, installer_package_name) - -def create_dmg(filename: str, dist_path: str, source_path: str) -> None: - """ Creates a dmg executable from UltiMaker-Cura.app named {filename}.dmg - - @param filename: The name of the app file and the output dmg file without the extension - @param dist_path: The location to read the app from and save the dmg to - @param source_path: The location of the project source files - """ - - dmg_filename = f"{filename}.dmg" - - build_dmg(source_path, dist_path, dmg_filename) - - code_sign(dist_path, dmg_filename) - - notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE")) - if notarize_dmg: - notarize_file(dist_path, dmg_filename) - - if __name__ == "__main__": - parser = argparse.ArgumentParser(description = "Create dmg of Cura.") + parser = argparse.ArgumentParser(description = "Create installer for Cura.") parser.add_argument("source_path", type=str, help="Path to Conan install Cura folder.") parser.add_argument("dist_path", type=str, help="Path to Pyinstaller dist folder") - parser.add_argument("filename", type = str, help = "Filename of the dmg/pkg without the file extension (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64')") + parser.add_argument("filename", type = str, help = "Filename of the pkg without the file extension (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64')") args = parser.parse_args() build_installer = bool(os.environ.get("BUILD_INSTALLER", "TRUE")) if build_installer: create_pkg_installer(args.filename, args.dist_path, args.source_path) - - build_dmg_executable = bool(os.environ.get("BUILD_DMG", "False")) - if build_dmg_executable: - create_dmg(args.filename, args.dist_path, args.source_path)