installers.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. name: All installers
  2. run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. cura_conan_version:
  7. description: 'Cura Conan Version'
  8. default: 'cura/latest@ultimaker/testing'
  9. required: true
  10. type: string
  11. conan_args:
  12. description: 'Conan args: eq.: --require-override'
  13. default: ''
  14. required: false
  15. type: string
  16. enterprise:
  17. description: 'Build Cura as an Enterprise edition'
  18. default: false
  19. required: true
  20. type: boolean
  21. staging:
  22. description: 'Use staging API'
  23. default: false
  24. required: true
  25. type: boolean
  26. nightly:
  27. description: 'Upload to nightly release'
  28. default: false
  29. required: true
  30. type: boolean
  31. workflow_call:
  32. inputs:
  33. cura_conan_version:
  34. default: 'cura/latest@ultimaker/testing'
  35. required: true
  36. type: string
  37. conan_args:
  38. default: ''
  39. required: false
  40. type: string
  41. enterprise:
  42. default: false
  43. required: true
  44. type: boolean
  45. staging:
  46. default: false
  47. required: true
  48. type: boolean
  49. nightly:
  50. default: false
  51. required: true
  52. type: boolean
  53. schedule:
  54. # Daily at 4:15 CET (main-branch) and 5:15 CET (release-branch)
  55. - cron: '15 3 * * *'
  56. - cron: '15 4 * * *'
  57. env:
  58. CONAN_ARGS: ${{ inputs.conan_args || '' }}
  59. ENTERPRISE: ${{ inputs.enterprise || false }}
  60. STAGING: ${{ inputs.staging || false }}
  61. jobs:
  62. default_values:
  63. uses: ultimaker/cura-workflows/.github/workflows/cura-installer-default-value.yml@main
  64. with:
  65. cura_conan_version: ${{ inputs.cura_conan_version }}
  66. latest_release: '5.6'
  67. latest_release_schedule_hour: 4
  68. latest_release_tag: 'nightly'
  69. windows-installer:
  70. uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@main
  71. needs: [ default_values ]
  72. with:
  73. cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
  74. conan_args: ${{ github.event.inputs.conan_args }}
  75. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  76. staging: ${{ github.event.inputs.staging == 'true' }}
  77. architecture: X64
  78. operating_system: self-hosted-Windows-X64
  79. secrets: inherit
  80. linux-installer:
  81. uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@main
  82. needs: [ default_values ]
  83. with:
  84. cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
  85. conan_args: ${{ github.event.inputs.conan_args }}
  86. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  87. staging: ${{ github.event.inputs.staging == 'true' }}
  88. architecture: X64
  89. operating_system: self-hosted-Ubuntu22-X64
  90. secrets: inherit
  91. macos-installer:
  92. uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main
  93. needs: [ default_values ]
  94. with:
  95. cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
  96. conan_args: ${{ github.event.inputs.conan_args }}
  97. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  98. staging: ${{ github.event.inputs.staging == 'true' }}
  99. architecture: X64
  100. operating_system: self-hosted-X64
  101. secrets: inherit
  102. macos-arm-installer:
  103. uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main
  104. needs: [ default_values ]
  105. with:
  106. cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
  107. conan_args: ${{ github.event.inputs.conan_args }}
  108. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  109. staging: ${{ github.event.inputs.staging == 'true' }}
  110. architecture: ARM64
  111. operating_system: self-hosted-ARM64
  112. secrets: inherit
  113. # Run and update nightly release when the nightly input is set to true or if the schedule is triggered
  114. update-nightly-release:
  115. if: ${{ inputs.nightly || github.event_name == 'schedule' }}
  116. runs-on: ubuntu-latest
  117. needs: [ default_values, windows-installer, linux-installer, macos-installer, macos-arm-installer ]
  118. steps:
  119. - name: Checkout
  120. uses: actions/checkout@v4
  121. with:
  122. fetch-depth: 1
  123. - name: Download the run info
  124. uses: actions/download-artifact@v4
  125. with:
  126. name: linux-run-info
  127. - name: Set the run info as environment variables
  128. run: |
  129. . run_info.sh
  130. - name: Output the name file name and extension
  131. id: filename
  132. shell: python
  133. run: |
  134. import os
  135. import datetime
  136. enterprise = "-Enterprise" if "${{ github.event.inputs.enterprise }}" == "true" else ""
  137. linux = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
  138. mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  139. mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  140. mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  141. mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  142. win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  143. win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  144. nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0]
  145. nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  146. output_env = os.environ["GITHUB_OUTPUT"]
  147. content = ""
  148. if os.path.exists(output_env):
  149. with open(output_env, "r") as f:
  150. content = f.read()
  151. with open(output_env, "w") as f:
  152. f.write(content)
  153. f.writelines(f"LINUX={linux}\n")
  154. f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n")
  155. f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n")
  156. f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n")
  157. f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
  158. f.writelines(f"WIN_MSI={win_msi}\n")
  159. f.writelines(f"WIN_EXE={win_exe}\n")
  160. f.writelines(f"NIGHTLY_NAME={nightly_name}\n")
  161. f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
  162. - name: Download linux installer jobs artifacts
  163. uses: actions/download-artifact@v4
  164. with:
  165. name: ${{ steps.filename.outputs.LINUX }}-AppImage
  166. path: installers
  167. - name: Download linux installer jobs asc artifacts
  168. uses: actions/download-artifact@v4
  169. with:
  170. name: ${{ steps.filename.outputs.LINUX }}-asc
  171. path: installers
  172. - name: Rename Linux installer to nightlies
  173. run: |
  174. mv installers/${{ steps.filename.outputs.LINUX }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage
  175. mv installers/${{ steps.filename.outputs.LINUX }}.AppImage.asc installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage.asc
  176. - name: Update nightly release for Linux
  177. run: |
  178. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber
  179. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage.asc --clobber
  180. env:
  181. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  182. - name: Download win msi installer jobs artifacts
  183. uses: actions/download-artifact@v4
  184. with:
  185. name: ${{ steps.filename.outputs.WIN_MSI }}-msi
  186. path: installers
  187. - name: Download win exe installer jobs artifacts
  188. uses: actions/download-artifact@v4
  189. with:
  190. name: ${{ steps.filename.outputs.WIN_EXE }}-exe
  191. path: installers
  192. - name: Rename Windows installers to nightlies
  193. run: |
  194. mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi
  195. mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe
  196. - name: Update nightly release for Windows
  197. run: |
  198. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber
  199. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber
  200. env:
  201. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  202. - name: Download MacOS (X64) dmg installer jobs artifacts
  203. uses: actions/download-artifact@v4
  204. with:
  205. name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
  206. path: installers
  207. - name: Download MacOS (X64) pkg installer jobs artifacts
  208. uses: actions/download-artifact@v4
  209. with:
  210. name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
  211. path: installers
  212. - name: Rename MacOS (X64) installers to nightlies
  213. run: |
  214. mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg
  215. mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg
  216. - name: Update nightly release for MacOS (X64)
  217. run: |
  218. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber
  219. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber
  220. env:
  221. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  222. - name: Download MacOS (ARM-64) dmg installer jobs artifacts
  223. uses: actions/download-artifact@v4
  224. with:
  225. name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
  226. path: installers
  227. - name: Download MacOS (ARM-64) pkg installer jobs artifacts
  228. uses: actions/download-artifact@v4
  229. with:
  230. name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
  231. path: installers
  232. - name: Rename MacOS (ARM-64) installers to nightlies
  233. run: |
  234. mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg
  235. mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg
  236. - name: Update nightly release for MacOS (ARM-64)
  237. run: |
  238. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber
  239. gh release upload ${{ needs.default_values.outputs.release_tag }} installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber
  240. env:
  241. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  242. - name: create the release notes
  243. shell: python
  244. run: |
  245. import os
  246. import datetime
  247. from jinja2 import Template
  248. with open(".github/workflows/release_notes.md.jinja", "r") as f:
  249. release_notes = Template(f.read())
  250. current_nightly_beta = "${{ needs.default_values.outputs.release_tag }}".split("nightly-")[-1]
  251. with open("release-notes.md", "w") as f:
  252. f.write(release_notes.render(
  253. timestamp="${{ steps.filename.outputs.NIGHTLY_TIME }}",
  254. branch="" if "${{ needs.default-values.outputs.release_tag == 'nightly' }}" == 'true' else current_nightly_beta,
  255. branch_specific="" if os.getenv("GITHUB_REF") == "refs/heads/main" else f"?branch={current_nightly_beta}",
  256. ))
  257. - name: Update nightly release description (with date)
  258. if: always()
  259. run: |
  260. gh release edit ${{ needs.default_values.outputs.release_tag }} --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes-file release-notes.md
  261. env:
  262. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}