123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- name: Cura Installer
- on:
- workflow_dispatch:
- inputs:
- cura_conan_version:
- description: 'Cura Conan Version'
- # Fixme: default to cura/latest@testing (which is main)
- default: 'cura/latest@ultimaker/stable'
- required: true
- conan_args:
- description: 'Conan args: eq.: --require-override=curaengine/5.1.0-beta+123@ultimaker/testing'
- default: ''
- required: false
- conan_config:
- description: 'Conan config branch to use'
- default: ''
- required: false
- enterprise:
- description: 'Build Cura as an Enterprise edition'
- required: true
- default: false
- type: boolean
- staging:
- description: 'Use staging API'
- required: true
- default: false
- type: boolean
- installer:
- description: 'Create the installer'
- required: true
- default: false
- type: boolean
- # Run the nightly at 3:25 UTC on working days
- #FIXME: Provide the same default values as the workflow dispatch
- schedule:
- - cron: '25 3 * * 1-5'
- env:
- CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
- CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
- CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
- CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
- CONAN_LOG_RUN_TO_OUTPUT: 1
- CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
- CONAN_NON_INTERACTIVE: 1
- CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }}
- MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }}
- MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }}
- MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
- MACOS_CERT_PASS: ${{ secrets.MACOS_CERT_PASS }}
- MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }}
- GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }}
- jobs:
- cura-installer-create:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- include:
- - { os: macos-10.15, os_id: 'mac' }
- - { os: windows-2022, os_id: 'win64' }
- - { os: ubuntu-20.04, os_id: 'linux' }
- - { os: ubuntu-22.04, os_id: 'linux-modern' }
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Setup Python and pip
- uses: actions/setup-python@v4
- with:
- python-version: '3.10.x'
- cache: 'pip'
- cache-dependency-path: .github/workflows/requirements-conan-package.txt
- - name: Install Python requirements and Create default Conan profile
- run: |
- pip install -r .github/workflows/requirements-conan-package.txt
- conan profile new default --detect
- - name: Use Conan download cache (Bash)
- if: ${{ runner.os != 'Windows' }}
- run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
- - name: Use Conan download cache (Powershell)
- if: ${{ runner.os == 'Windows' }}
- run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache"
- - name: Cache Conan local repository packages (Bash)
- uses: actions/cache@v3
- if: ${{ runner.os != 'Windows' }}
- with:
- path: |
- $HOME/.conan/data
- $HOME/.conan/conan_download_cache
- key: conan-${{ runner.os }}-${{ runner.arch }}
- - name: Cache Conan local repository packages (Powershell)
- uses: actions/cache@v3
- if: ${{ runner.os == 'Windows' }}
- with:
- path: |
- C:\Users\runneradmin\.conan\data
- C:\.conan
- C:\Users\runneradmin\.conan\conan_download_cache
- key: conan-${{ runner.os }}-${{ runner.arch }}
- - name: Install MacOS system requirements
- if: ${{ runner.os == 'Macos' }}
- run: brew install autoconf automake ninja create-dmg
- - name: Install Linux system requirements
- if: ${{ runner.os == 'Linux' }}
- run: |
- sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y
- wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool
- chmod +x $GITHUB_WORKSPACE/appimagetool
- echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
- - name: Configure GPG Key Linux (Bash)
- if: ${{ runner.os == 'Linux' }}
- run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import
- - name: Configure Macos keychain (Bash)
- id: macos-keychain
- if: ${{ runner.os == 'Macos' }}
- uses: apple-actions/import-codesign-certs@v1
- with:
- p12-file-base64: ${{ secrets.MACOS_CERT_P12 }}
- p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }}
- - name: Get Conan configuration from branch
- if: ${{ inputs.conan_config_branch != '' }}
- run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
- - name: Get Conan configuration
- if: ${{ inputs.conan_config_branch == '' }}
- run: conan config install https://github.com/Ultimaker/conan-config.git
- - name: Create the Packages
- run: conan install ${{ inputs.cura_conan_version }} ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=${{ inputs.enterprise }} -o cura:staging=${{ inputs.staging }} --json "cura_inst/conan_install_info.json"
- - name: Set Environment variables for Cura (bash)
- if: ${{ runner.os != 'Windows' }}
- run: |
- . ./cura_inst/bin/activate_github_actions_env.sh
- . ./cura_inst/bin/activate_github_actions_version_env.sh
- - name: Set Environment variables for Cura (Powershell)
- if: ${{ runner.os == 'Windows' }}
- run: |
- .\cura_inst\Scripts\activate_github_actions_env.ps1
- .\cura_inst\Scripts\activate_github_actions_version_env.ps1
- - name: Unlock Macos keychain (Bash)
- if: ${{ runner.os == 'Macos' }}
- run: security unlock -p $TEMP_KEYCHAIN_PASSWORD signing_temp.keychain
- env:
- TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain.outputs.keychain-password }}
- # FIXME: This is a workaround to ensure that we use and pack a shared library for OpenSSL 1.1.1l. We currently compile
- # OpenSSL statically for CPython, but our Python Dependenies (such as PyQt6) require a shared library.
- # Because Conan won't allow for building the same library with two different options (easily) we need to install it explicitly
- # and do a manual copy to the VirtualEnv, such that Pyinstaller can find it.
- - name: Install OpenSSL shared
- run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy
- - name: Copy OpenSSL shared (Bash)
- if: ${{ runner.os != 'Windows' }}
- run: |
- cp ./openssl/lib/*.so* ./cura_inst/bin/ || true
- cp ./openssl/lib/*.dylib* ./cura_inst/bin/ || true
- - name: Copy OpenSSL shared (Powershell)
- if: ${{ runner.os == 'Windows' }}
- run: |
- cp openssl/bin/*.dll ./cura_inst/Scripts/
- cp openssl/lib/*.lib ./cura_inst/Lib/
- - name: Create the Cura dist
- run: pyinstaller ./cura_inst/Ultimaker-Cura.spec
- - name: Archive the artifacts (bash)
- if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
- run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.tar.gz" "./Ultimaker-Cura/"
- working-directory: dist
- - name: Archive the artifacts (Powershell)
- if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
- run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.zip"
- working-directory: dist
- - name: Create the Windows exe installer (Powershell)
- if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
- run: |
- python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.exe"
- working-directory: dist
- - 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-$CURA_VERSION_FULL-${{ matrix.os_id }}.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_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.dmg"
- working-directory: dist
- - name: Upload the artifacts
- uses: actions/upload-artifact@v3
- with:
- name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}
- path: |
- dist/*.tar.gz
- dist/*.zip
- dist/*.exe
- dist/*.msi
- dist/*.dmg
- dist/*.AppImage
- dist/*.asc
- retention-days: 5
- notify-export:
- if: ${{ always() }}
- needs: [ cura-installer-create ]
- uses: ultimaker/cura/.github/workflows/notify.yml@main
- with:
- success: ${{ contains(join(needs.*.result, ','), 'success') }}
- success_title: "Create the Cura distributions"
- success_body: "Installers for ${{ inputs.cura_conan_version }}"
- failure_title: "Failed to create the Cura distributions"
- failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}"
- secrets: inherit
|