cura-installer.yml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. name: Cura Installer
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. cura_conan_version:
  6. description: 'Cura Conan Version'
  7. # Fixme: default to cura/latest@testing (which is main)
  8. default: 'cura/latest@ultimaker/stable'
  9. required: true
  10. conan_config:
  11. description: 'Conan config branch to use'
  12. default: ''
  13. required: false
  14. enterprise:
  15. description: 'Build Cura as an Enterprise edition'
  16. required: true
  17. default: false
  18. type: boolean
  19. staging:
  20. description: 'Use staging API'
  21. required: true
  22. default: false
  23. type: boolean
  24. installer:
  25. description: 'Create the installer'
  26. required: true
  27. default: false
  28. type: boolean
  29. # Run the nightly at 5:25 UTC on working days
  30. schedule:
  31. - cron: '25 3 * * 1-5'
  32. env:
  33. CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
  34. CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
  35. CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
  36. CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
  37. CONAN_LOG_RUN_TO_OUTPUT: 1
  38. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  39. CONAN_NON_INTERACTIVE: 1
  40. CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }}
  41. MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }}
  42. MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }}
  43. MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
  44. jobs:
  45. cura-installer-create:
  46. runs-on: ${{ matrix.os }}
  47. strategy:
  48. fail-fast: false
  49. matrix:
  50. os: [ macos-10.15, windows-2022, ubuntu-20.04 ]
  51. steps:
  52. - name: Checkout
  53. uses: actions/checkout@v3
  54. - name: Setup Python and pip
  55. uses: actions/setup-python@v4
  56. with:
  57. python-version: '3.10.4'
  58. cache: 'pip'
  59. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  60. - name: Install Python requirements and Create default Conan profile
  61. run: |
  62. pip install -r .github/workflows/requirements-conan-package.txt
  63. conan profile new default --detect
  64. - name: Use Conan download cache (Bash)
  65. if: ${{ runner.os != 'Windows' }}
  66. run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
  67. - name: Use Conan download cache (Powershell)
  68. if: ${{ runner.os == 'Windows' }}
  69. run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache"
  70. - name: Cache Conan local repository packages (Bash)
  71. uses: actions/cache@v3
  72. if: ${{ runner.os != 'Windows' }}
  73. with:
  74. path: |
  75. $HOME/.conan/data
  76. $HOME/.conan/conan_download_cache
  77. key: conan-${{ runner.os }}-${{ runner.arch }}
  78. - name: Cache Conan local repository packages (Powershell)
  79. uses: actions/cache@v3
  80. if: ${{ runner.os == 'Windows' }}
  81. with:
  82. path: |
  83. C:\Users\runneradmin\.conan\data
  84. C:\.conan
  85. C:\Users\runneradmin\.conan\conan_download_cache
  86. key: conan-${{ runner.os }}-${{ runner.arch }}
  87. - name: Install MacOS system requirements
  88. if: ${{ runner.os == 'Macos' }}
  89. run: brew install autoconf automake ninja
  90. - name: Install Linux system requirements
  91. if: ${{ runner.os == 'Linux' }}
  92. run: sudo apt install build-essential checkinstall 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 -y
  93. - name: Clean Conan local cache
  94. if: ${{ inputs.conan_clean_local_cache }}
  95. run: conan remove "*" -f
  96. - name: Get Conan configuration from branch
  97. if: ${{ inputs.conan_config_branch != '' }}
  98. run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
  99. - name: Get Conan configuration
  100. if: ${{ inputs.conan_config_branch == '' }}
  101. run: conan config install https://github.com/Ultimaker/conan-config.git
  102. - name: Create the Packages
  103. run: conan install ${{ inputs.cura_conan_version }} --build=missing --update -c tools.env.virtualenv:powershell=True -if cura_inst -g VirtualPythonEnv -o cura:enterprise=${{ inputs.enterprise }} -o cura:staging=${{ inputs.staging }}
  104. - name: Upload the Package(s)
  105. if: always()
  106. run: |
  107. conan upload "*" -r cura --all -c
  108. conan upload "*" -r cura-ce -c
  109. - name: Set Environment variables for Cura (bash)
  110. if: ${{ runner.os != 'Windows' }}
  111. run: |
  112. . ./cura_inst/bin/activate_github_actions_env.sh
  113. . ./cura_inst/bin/activate_github_actions_version_env.sh
  114. - name: Set Environment variables for Cura (Powershell)
  115. if: ${{ runner.os == 'Windows' }}
  116. run: |
  117. .\cura_inst\Scripts\activate_github_actions_env.ps1
  118. .\cura_inst\Scripts\activate_github_actions_version_env.ps1
  119. - name: Create the Cura dist
  120. run: pyinstaller ./cura_inst/Ultimaker-Cura.spec
  121. - name: Archive the artifacts (bash)
  122. if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
  123. run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/"
  124. working-directory: dist
  125. - name: Archive the artifacts (Powershell)
  126. if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
  127. run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.zip"
  128. working-directory: dist
  129. - name: Create the Windows exe installer (Powershell)
  130. if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
  131. run: |
  132. python ..\cura_inst\packaging\NSIS\nsis-configurator.py ".\Ultimaker-Cura" "..\cura_inst\packaging\NSIS\Ultimaker-Cura.nsi.jinja" "Ultimaker Cura" "Ultimaker-Cura.exe" "$Env:CURA_VERSION_MAJOR" "$Env:CURA_VERSION_MINOR" "$Env:CURA_VERSION_PATCH" "$Env:CURA_VERSION_BUILD" "Ultimaker B.V." "https://ultimaker.com" "..\cura_inst\packaging\cura_license.txt" "LZMA" "..\cura_inst\packaging\NSIS\cura_banner_nsis.bmp" "..\cura_inst\packaging\icons\Cura.ico" "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.exe"
  133. makensis /V2 /P4 Ultimaker-Cura.nsi
  134. working-directory: dist
  135. - name: Create the Linux AppImage (Bash)
  136. if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
  137. run: python ./Ultimaker-Cura $CURA_VERSION_FULL
  138. working-directory: dist
  139. - name: Upload the artifacts
  140. uses: actions/upload-artifact@v3
  141. with:
  142. name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ runner.os }}-${{ runner.arch }}
  143. path: |
  144. dist/*.tar.gz
  145. dist/*.zip
  146. dist/*.exe
  147. dist/*.msi
  148. dist/*.dmg
  149. dist/*.AppImage
  150. retention-days: 2