installers.yml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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 8:10 CET
  33. - cron: '10 7 * * *'
  34. env:
  35. CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }}
  36. CONAN_ARGS: ${{ inputs.conan_args || '' }}
  37. ENTERPRISE: ${{ inputs.enterprise || false }}
  38. STAGING: ${{ inputs.staging || false }}
  39. jobs:
  40. windows-installer:
  41. uses: ./.github/workflows/windows.yml
  42. with:
  43. cura_conan_version: ${{ github.event.inputs.cura_conan_version }}
  44. conan_args: ${{ github.event.inputs.conan_args }}
  45. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  46. staging: ${{ github.event.inputs.staging == 'true' }}
  47. architecture: X64
  48. operating_system: windows-2022
  49. secrets: inherit
  50. linux-installer:
  51. uses: ./.github/workflows/linux.yml
  52. with:
  53. cura_conan_version: ${{ github.event.inputs.cura_conan_version }}
  54. conan_args: ${{ github.event.inputs.conan_args }}
  55. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  56. staging: ${{ github.event.inputs.staging == 'true' }}
  57. architecture: X64
  58. operating_system: ubuntu-22.04
  59. secrets: inherit
  60. macos-installer:
  61. uses: ./.github/workflows/macos.yml
  62. with:
  63. cura_conan_version: ${{ github.event.inputs.cura_conan_version }}
  64. conan_args: ${{ github.event.inputs.conan_args }}
  65. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  66. staging: ${{ github.event.inputs.staging == 'true' }}
  67. architecture: X64
  68. operating_system: macos-11.0
  69. secrets: inherit
  70. # macos-arm-installer:
  71. # uses: ./.github/workflows/macos.yml
  72. # with:
  73. # cura_conan_version: ${{ github.event.inputs.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: ARM64
  78. # operating_system: self-hosted
  79. # secrets: inherit
  80. # Run and update nightly release when the nightly input is set to true or if the schedule is triggered
  81. update-nightly-release:
  82. if: ${{ always() && (! cancelled()) && contains(needs.*.result, 'success') && (! contains(needs.*.result, 'failure')) && (inputs.nightly || github.event_name == 'schedule') }}
  83. runs-on: ubuntu-latest
  84. needs: [ windows-installer, linux-installer, macos-installer ]
  85. # needs: [ windows-installer, linux-installer, macos-installer, macos-arm-installer ]
  86. steps:
  87. - name: Checkout
  88. uses: actions/checkout@v3
  89. # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped.
  90. - name: Download the run info
  91. uses: actions/download-artifact@v2
  92. with:
  93. name: linux-run-info
  94. - name: Set the run info as environment variables
  95. run: |
  96. . run_info.sh
  97. - name: Output the name file name and extension
  98. id: filename
  99. shell: python
  100. run: |
  101. import os
  102. import datetime
  103. enterprise = "-Enterprise" if "${{ github.event.inputs.enterprise }}" == "true" else ""
  104. linux = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
  105. mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  106. mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  107. mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  108. mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  109. win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  110. win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  111. nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0]
  112. nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  113. output_env = os.environ["GITHUB_OUTPUT"]
  114. content = ""
  115. if os.path.exists(output_env):
  116. with open(output_env, "r") as f:
  117. content = f.read()
  118. with open(output_env, "w") as f:
  119. f.write(content)
  120. f.writelines(f"LINUX={linux}\n")
  121. f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n")
  122. f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n")
  123. f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n")
  124. f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
  125. f.writelines(f"WIN_MSI={win_msi}\n")
  126. f.writelines(f"WIN_EXE={win_exe}\n")
  127. f.writelines(f"NIGHTLY_NAME={nightly_name}\n")
  128. f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
  129. - name: Download linux installer jobs artifacts
  130. uses: actions/download-artifact@v2
  131. with:
  132. name: ${{ steps.filename.outputs.LINUX }}-AppImage
  133. path: installers
  134. - name: Rename Linux installer to nightlies
  135. run: |
  136. mv installers/${{ steps.filename.outputs.LINUX }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage
  137. - name: Update nightly release for Linux
  138. run: |
  139. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber
  140. env:
  141. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  142. - name: Download win msi installer jobs artifacts
  143. uses: actions/download-artifact@v2
  144. with:
  145. name: ${{ steps.filename.outputs.WIN_MSI }}-msi
  146. path: installers
  147. - name: Download win exe installer jobs artifacts
  148. uses: actions/download-artifact@v2
  149. with:
  150. name: ${{ steps.filename.outputs.WIN_EXE }}-exe
  151. path: installers
  152. - name: Rename Windows installers to nightlies
  153. run: |
  154. mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi
  155. mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe
  156. - name: Update nightly release for Windows
  157. run: |
  158. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber
  159. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber
  160. env:
  161. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  162. - name: Download MacOS (X64) dmg installer jobs artifacts
  163. uses: actions/download-artifact@v2
  164. with:
  165. name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
  166. path: installers
  167. - name: Download MacOS (X64) pkg installer jobs artifacts
  168. uses: actions/download-artifact@v2
  169. with:
  170. name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
  171. path: installers
  172. - name: Rename MacOS (X64) installers to nightlies
  173. run: |
  174. mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg
  175. mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg
  176. - name: Update nightly release for MacOS (X64)
  177. run: |
  178. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber
  179. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber
  180. env:
  181. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  182. # - name: Download MacOS (ARM-64) dmg installer jobs artifacts
  183. # uses: actions/download-artifact@v2
  184. # with:
  185. # name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
  186. # path: installers
  187. #
  188. # - name: Download MacOS (ARM-64) pkg installer jobs artifacts
  189. # uses: actions/download-artifact@v2
  190. # with:
  191. # name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
  192. # path: installers
  193. #
  194. # - name: Rename MacOS (ARM-64) installers to nightlies
  195. # run: |
  196. # mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg
  197. # mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg
  198. #
  199. # - name: Update nightly release for MacOS (ARM-64)
  200. # run: |
  201. # gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber
  202. # gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber
  203. # env:
  204. # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  205. - name: Update nightly release description (with date)
  206. if: always()
  207. run: |
  208. gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}"
  209. env:
  210. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}