nightly.yml 2.4 KB

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