uniform name on macos

Contributes to CURA-9365
This commit is contained in:
j.spijker@ultimaker.com 2022-07-06 08:32:05 +02:00 committed by jspijker
parent bee2b22edf
commit feebf6d003
2 changed files with 16 additions and 13 deletions

View file

@ -181,12 +181,12 @@ jobs:
- name: Create the Linux AppImage (Bash)
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}"
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.AppImage"
working-directory: dist
- name: Create the MacOS dmg (Bash)
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
run: python ../cura_inst/packaging/dmg/dmg_sign_notarize.py
run: python ../cura_inst/packaging/dmg/dmg_sign_notarize.py "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.dmg"
working-directory: dist
env:
SOURCE_DIR: ${{ env.GITHUB_WORKSPACE }}/cura_inst

View file

@ -1,14 +1,14 @@
import os
import argparse # Command line arguments parsing and help.
import subprocess
SOURCE_DIR = os.environ.get("SOURCE_DIR", ".")
DIST_DIR = os.environ.get("DIST_DIR", os.path.join(SOURCE_DIR, "dist"))
DMG_PATH = "Ultimaker-Cura.dmg"
APP_PATH = os.path.join(DIST_DIR, "Ultimaker-Cura.app")
ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura")
def build_dmg() -> None:
def build_dmg(filename: str) -> None:
create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg")
arguments = [create_dmg_executable,
@ -20,26 +20,26 @@ def build_dmg() -> None:
"--icon", "Ultimaker-Cura.app", "169", "272",
"--eula", f"{SOURCE_DIR}/packaging/cura_license.txt",
"--background", f"{SOURCE_DIR}/packaging/icons/cura_background_dmg.png",
DMG_PATH,
filename,
APP_PATH]
subprocess.run(arguments)
def sign(file_path: str) -> None:
def sign(filename: str) -> None:
codesign_executable = os.environ.get("CODESIGN", "codesign")
codesign_identity = os.environ.get("CODESIGN_IDENTITY")
arguments = [codesign_executable,
"-s", codesign_identity,
"--timestamp",
"-i", f"{ULTIMAKER_CURA_DOMAIN}.dmg",
file_path]
"-i", f"{ULTIMAKER_CURA_DOMAIN}.dmg", # TODO: check if this really should have the extra dmg. We seem to be doing this also in the old Rundeck scripts
filename]
subprocess.run(arguments)
def notarize() -> None:
def notarize(filename: str) -> None:
notarize_user = os.environ.get("MAC_NOTARIZE_USER")
notarize_password = os.environ.get("MAC_NOTARIZE_PASSWORD")
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "altool")
@ -50,16 +50,19 @@ def notarize() -> None:
"--primary-bundle-id", ULTIMAKER_CURA_DOMAIN,
"--username", notarize_user,
"--password", notarize_password,
"--file", DMG_PATH
"--file", filename
]
subprocess.run(arguments)
if __name__ == "__main__":
build_dmg()
sign(DMG_PATH)
parser = argparse.ArgumentParser(description = "Create AppImages of Cura.")
parser.add_argument("filename", type = str, help = "Filename of the dmg (e.g. 'Ultimaker-Cura-5.1.0-beta-Linux-X64.dmg')")
args = parser.parse_args()
build_dmg(args.filename)
sign(args.filename)
notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
if notarize_dmg:
notarize()
notarize(args.filename)