nightly.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Nightly build
  2. run-name: Nightly build
  3. on:
  4. workflow_call:
  5. inputs:
  6. cura_conan_version:
  7. required: true
  8. type: string
  9. release_tag:
  10. required: true
  11. type: string
  12. caller_workflow:
  13. required: true
  14. type: string
  15. jobs:
  16. create-installers:
  17. name: Create installers
  18. id: create-installers
  19. # FIXME: Use main once merged
  20. uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2
  21. with:
  22. cura_conan_version: ${{ inputs.cura_conan_version }}
  23. secrets: inherit
  24. update-nightly-release:
  25. name: Upload installers
  26. runs-on: ubuntu-latest
  27. needs: [ create-installers ]
  28. steps:
  29. - name: Setup the build environment
  30. # FIXME: Use main once merged
  31. uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@CURA-11622_conan_v2
  32. - name: Download installers jobs artifacts
  33. uses: actions/download-artifact@v4
  34. with:
  35. pattern: UltiMaker-Cura-*
  36. path: installers
  37. merge-multiple: true
  38. - name: Rename the installers
  39. id: rename-installers
  40. working-directory: installers
  41. run: python ./Cura-workflows/runner_scripts/rename_installers.py --tag "nightly" >> $GITHUB_OUTPUT
  42. - name: create the release notes
  43. shell: python
  44. run: |
  45. import os
  46. import datetime
  47. from jinja2 import Template
  48. with open(".github/workflows/nightly_release_notes.md.jinja", "r") as f:
  49. release_notes = Template(f.read())
  50. short_version = "${{ steps.rename-installers.outputs.short_version }}"
  51. caller_workflow = "${{ inputs.caller_workflow }}"
  52. is_main = os.getenv("GITHUB_REF") == "refs/heads/main"
  53. with open("release-notes.md", "w") as f:
  54. f.write(release_notes.render(
  55. timestamp=str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")),
  56. caller_workflow=caller_workflow,
  57. branch="" if is_main else short_version,
  58. branch_specific="" is_main else f"?branch={short_version}",
  59. ))
  60. - name: Update nightly release description and binaries
  61. working-directory: installers
  62. run: |
  63. gh release edit ${{ inputs.release_tag }} --title "${{ steps.rename-installers.outputs.cura_version }}" --notes-file release-notes.md
  64. for file in "*"; do
  65. gh release upload ${{ inputs.release_tag }} $file --clobber
  66. done
  67. env:
  68. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}