release-process_release-candidate.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml@main
  32. needs: [parse-version]
  33. with:
  34. cura_version: ${{ inputs.cura_version }}
  35. branch: ${{ needs.parse-version.outputs.branch_name }}
  36. create_feature_branch: false
  37. secrets: inherit
  38. find-rc-tag:
  39. name: Find RC tag name
  40. runs-on: ubuntu-latest
  41. needs: [freeze-packages-versions]
  42. outputs:
  43. tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
  44. steps:
  45. - name: Checkout repo
  46. uses: actions/checkout@v4
  47. with:
  48. fetch-tags: true
  49. fetch-depth: 0
  50. - name: Find available tag name
  51. id: find-available-tag-name
  52. run: |
  53. VERSION=${{ inputs.cura_version }}
  54. RC_INDEX=0
  55. while
  56. RC_INDEX=$((RC_INDEX+1))
  57. TAG_NAME="$VERSION-RC$RC_INDEX"
  58. [[ $(git tag -l "$TAG_NAME") ]]
  59. do true; done
  60. echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
  61. create-tags:
  62. name: Create tags
  63. runs-on: ubuntu-latest
  64. needs: [parse-version, find-rc-tag]
  65. outputs:
  66. main_commit: ${{ steps.export-main-commit.outputs.main_commit }}
  67. strategy:
  68. matrix:
  69. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  70. steps:
  71. - name: Checkout repo
  72. uses: actions/checkout@v4
  73. with:
  74. repository: Ultimaker/${{ matrix.repository }}
  75. ref: ${{ needs.parse-version.outputs.branch_name }}
  76. token: ${{ secrets.CURA_AUTORELEASE_PAT }}
  77. - name: Create RC tag
  78. run: |
  79. git tag ${{ needs.find-rc-tag.outputs.tag_name }}
  80. git push origin tag ${{ needs.find-rc-tag.outputs.tag_name }}
  81. - name: Create or update release tag
  82. run: |
  83. git tag -f ${{ inputs.cura_version }}
  84. git push -f origin tag ${{ inputs.cura_version }}
  85. - name: Export Cura tagged commit
  86. id: export-main-commit
  87. if: ${{ matrix.repository == 'Cura' }}
  88. run: |
  89. echo "main_commit=`git rev-parse HEAD`" >> "$GITHUB_OUTPUT"
  90. create-packages:
  91. name: Create conan packages
  92. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@main
  93. needs: [parse-version, freeze-packages-versions]
  94. strategy:
  95. matrix:
  96. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  97. include:
  98. - conan_recipe_root: "."
  99. - repository: Cura
  100. conan_recipe_root: "resources"
  101. with:
  102. repository: ${{ matrix.repository }}
  103. branch: ${{ needs.parse-version.outputs.branch_name }}
  104. conan_recipe_root: ${{ matrix.conan_recipe_root }}
  105. secrets: inherit
  106. create-installers:
  107. name: Create installers
  108. uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@main
  109. needs: [parse-version, create-packages]
  110. with:
  111. cura_conan_version: cura/${{ inputs.cura_version }}@ultimaker/stable
  112. conan_args: "-c user.sentry:environment=production"
  113. secrets: inherit
  114. create-release-draft:
  115. name: Create the release draft
  116. runs-on: ubuntu-latest
  117. needs: [create-installers, parse-version, create-tags]
  118. steps:
  119. - name: Checkout Cura repo
  120. uses: actions/checkout@v4
  121. with:
  122. ref: ${{ needs.parse-version.outputs.branch_name }}
  123. - name: Extract changelog
  124. if: ${{ inputs.publish_release_description }}
  125. 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
  126. - name: Create release
  127. uses: notpeelz/action-gh-create-release@v5.0.1
  128. if: ${{ inputs.publish_release_description }}
  129. with:
  130. target: ${{ needs.create-tags.outputs.main_commit }}
  131. tag: ${{ inputs.cura_version }}
  132. strategy: replace
  133. title: UltiMaker Cura ${{ inputs.cura_version }}
  134. draft: true
  135. body-source: file
  136. body: formatted_changelog.txt
  137. - name: Download artifacts
  138. uses: actions/download-artifact@v4
  139. with:
  140. path: artifacts
  141. merge-multiple: true
  142. - name: Upload artifacts
  143. working-directory: artifacts
  144. run: |
  145. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage --clobber
  146. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage.asc --clobber
  147. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.dmg --clobber
  148. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.pkg --clobber
  149. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.dmg --clobber
  150. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.pkg --clobber
  151. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.exe --clobber
  152. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.msi --clobber
  153. env:
  154. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}