diff --git a/.github/workflows/cura-all-installers.yml b/.github/workflows/cura-all-installers.yml index ddad7bd9d9..34ccffe54b 100644 --- a/.github/workflows/cura-all-installers.yml +++ b/.github/workflows/cura-all-installers.yml @@ -1,5 +1,5 @@ name: Cura All Installers -run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, appimage ${{ inputs.build_linux }} +run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, appimage ${{ inputs.build_linux }} - enterprise ${{ inputs.enterprise }} on: workflow_dispatch: diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index cef65061e2..fd1922b898 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -229,26 +229,50 @@ jobs: - name: Create the Cura dist run: pyinstaller ./cura_inst/UltiMaker-Cura.spec + - name: Output the name file name and extension + id: filename + shell: python + run: | + import os + enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" + installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-${{ inputs.os_name }}" + if "${{ runner.os }}" == "Windows": + installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe" + elif "${{ runner.os }}" == "Macos": + installer_ext = "dmg" + else: + installer_ext = "AppImage" + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") + f.writelines(f"INSTALLER_EXT={installer_ext}\n") + f.writelines(f"FULL_INSTALLER_FILENAME={installer_filename}.{installer_ext}\n") + - name: Archive the artifacts (bash) if: ${{ !inputs.installer && runner.os != 'Windows' }} - run: tar -zcf "./UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.tar.gz" "./UltiMaker-Cura/" + run: tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./UltiMaker-Cura/" working-directory: dist - name: Archive the artifacts (Powershell) if: ${{ !inputs.installer && runner.os == 'Windows' }} - run: Compress-Archive -Path ".\UltiMaker-Cura" -DestinationPath ".\UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.zip" + run: Compress-Archive -Path ".\UltiMaker-Cura" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip" working-directory: dist - name: Create the Windows exe installer (Powershell) if: ${{ inputs.installer && runner.os == 'Windows' && !inputs.msi_installer }} run: | - python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.exe" + python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Create the Windows msi installer (Powershell) if: ${{ inputs.installer && runner.os == 'Windows' && inputs.msi_installer }} run: | - python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.msi" "$Env:CURA_APP_NAME" + python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" "$Env:CURA_APP_NAME" working-directory: dist - name: Sign the Windows exe installer (Powershell) @@ -256,7 +280,7 @@ jobs: env: PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.exe" + & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Sign the Windows msi installer (Powershell) @@ -264,30 +288,27 @@ jobs: env: PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "UltiMaker-Cura-$Env:CURA_VERSION_FULL-${{ inputs.os_name }}.msi" + & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Create the Linux AppImage (Bash) if: ${{ inputs.installer && runner.os == 'Linux' }} - run: python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.AppImage" + 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 (Bash) if: ${{ inputs.installer && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "UltiMaker-Cura-$CURA_VERSION_FULL-${{ inputs.os_name }}.dmg" + run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Upload the artifacts uses: actions/upload-artifact@v3 with: - name: UltiMaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ inputs.os_name }} + name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-${{ steps.filename.outputs.INSTALLER_EXT }} path: | dist/*.tar.gz dist/*.zip - dist/*.exe - dist/*.msi - dist/*.dmg - dist/*.AppImage + dist/${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }} dist/*.asc retention-days: 5