installers.yml 12 KB

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