release-process_release-candidate.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. name: Prepare Release Candidate
  2. run-name: Release Candidate for Cura ${{ inputs.cura_version }} by @${{ github.actor }}
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. cura_version:
  7. description: 'Cura version number, e.g. 5.7.0, 5.7.2 or 5.8.0-beta.2'
  8. required: true
  9. type: string
  10. publish_release_description:
  11. description: 'Create the GitHub release (if existing, the description will be overridden based on the changelog)'
  12. required: true
  13. type: boolean
  14. jobs:
  15. parse-version:
  16. name: Parse input version string
  17. runs-on: ubuntu-latest
  18. outputs:
  19. version_major: ${{ steps.version_parser.outputs.major }}
  20. version_minor: ${{ steps.version_parser.outputs.minor }}
  21. version_patch: ${{ steps.version_parser.outputs.patch }}
  22. branch_name: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}
  23. steps:
  24. - name: Parse version string
  25. id: version_parser
  26. uses: booxmedialtd/ws-action-parse-semver@v1.4.7
  27. with:
  28. input_string: ${{ inputs.cura_version }}
  29. freeze-packages-versions:
  30. name: Freeze packges versions
  31. # FIXME: Use main once merged
  32. uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml@CURA-11622_conan_v2
  33. needs: [parse-version]
  34. with:
  35. cura_version: ${{ inputs.cura_version }}
  36. branch: ${{ needs.parse-version.outputs.branch_name }}
  37. create_feature_branch: false
  38. secrets: inherit
  39. find-rc-tag:
  40. name: Find RC tag name
  41. runs-on: ubuntu-latest
  42. needs: [freeze-packages-versions]
  43. outputs:
  44. tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
  45. steps:
  46. - name: Checkout repo
  47. uses: actions/checkout@v4
  48. with:
  49. fetch-tags: true
  50. fetch-depth: 0
  51. - name: Find available tag name
  52. id: find-available-tag-name
  53. run: |
  54. VERSION=${{ inputs.cura_version }}
  55. RC_INDEX=0
  56. while
  57. RC_INDEX=$((RC_INDEX+1))
  58. TAG_NAME="$VERSION-RC$RC_INDEX"
  59. [[ $(git tag -l "$TAG_NAME") ]]
  60. do true; done
  61. echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
  62. create-tags:
  63. name: Create tags
  64. runs-on: ubuntu-latest
  65. needs: [parse-version, find-rc-tag]
  66. outputs:
  67. main_commit: ${{ steps.export-main-commit.outputs.main_commit }}
  68. strategy:
  69. matrix:
  70. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  71. steps:
  72. - name: Checkout repo
  73. uses: actions/checkout@v4
  74. with:
  75. repository: Ultimaker/${{ matrix.repository }}
  76. ref: ${{ needs.parse-version.outputs.branch_name }}
  77. token: ${{ secrets.CURA_AUTORELEASE_PAT }}
  78. - name: Create RC tag
  79. run: |
  80. git tag ${{ needs.find-rc-tag.outputs.tag_name }}
  81. git push origin tag ${{ needs.find-rc-tag.outputs.tag_name }}
  82. - name: Create or update release tag
  83. run: |
  84. git tag -f ${{ inputs.cura_version }}
  85. git push -f origin tag ${{ inputs.cura_version }}
  86. - name: Export Cura tagged commit
  87. id: export-main-commit
  88. if: ${{ matrix.repository == 'Cura' }}
  89. run: |
  90. echo "main_commit=`git rev-parse HEAD`" >> "$GITHUB_OUTPUT"
  91. create-packages:
  92. name: Create conan packages
  93. # FIXME: Use main once merged
  94. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@CURA-11622_conan_v2
  95. needs: [parse-version, freeze-packages-versions]
  96. strategy:
  97. matrix:
  98. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  99. include:
  100. - conan_recipe_root: "."
  101. - repository: Cura
  102. conan_recipe_root: "resources"
  103. with:
  104. repository: Ultimaker/${{ matrix.repository }}
  105. branch: ${{ needs.parse-version.outputs.branch_name }}
  106. conan_recipe_root: ${{ matrix.conan_recipe_root }}
  107. secrets: inherit
  108. create-installers:
  109. name: Create installers
  110. # FIXME: Use main once merged
  111. uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2
  112. needs: [parse-version, create-packages]
  113. with:
  114. cura_conan_version: cura/${{ inputs.cura_version }}@ultimaker/stable
  115. conan_args: "-c user.sentry:environment=production"
  116. secrets: inherit
  117. create-release-draft:
  118. name: Create the release draft
  119. runs-on: ubuntu-latest
  120. needs: [create-installers, parse-version, create-tags]
  121. steps:
  122. - name: Checkout Cura repo
  123. uses: actions/checkout@v4
  124. with:
  125. ref: ${{ needs.parse-version.outputs.branch_name }}
  126. - name: Extract changelog
  127. if: ${{ inputs.publish_release_description }}
  128. run: python ./scripts/extract_changelog.py --version ${{ needs.parse-version.outputs.version_major }}.${{ needs.parse-version.outputs.version_minor }}.${{ needs.parse-version.outputs.version_patch }} --changelog ./resources/texts/change_log.txt > formatted_changelog.txt
  129. - name: Create release
  130. uses: notpeelz/action-gh-create-release@v5.0.1
  131. if: ${{ inputs.publish_release_description }}
  132. with:
  133. target: ${{ needs.create-tags.outputs.main_commit }}
  134. tag: ${{ inputs.cura_version }}
  135. strategy: replace
  136. title: UltiMaker Cura ${{ inputs.cura_version }}
  137. draft: true
  138. body-source: file
  139. body: formatted_changelog.txt
  140. - name: Download artifacts
  141. uses: actions/download-artifact@v4
  142. with:
  143. path: artifacts
  144. merge-multiple: true
  145. - name: Upload artifacts
  146. working-directory: artifacts
  147. run: |
  148. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage --clobber
  149. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage.asc --clobber
  150. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.dmg --clobber
  151. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.pkg --clobber
  152. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.dmg --clobber
  153. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.pkg --clobber
  154. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.exe --clobber
  155. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.msi --clobber
  156. env:
  157. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}