release-upgrade-notes.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. name: Release upgrade notes
  3. # Upgrade notes for merged but unreleased changes live under
  4. # "Next release (unreleased)" in upgrade_notes.adoc. When a 3k release is
  5. # tagged, move the notes that shipped in it under a heading for that version
  6. # on the next branch, which is where docs.olivetin.app is built from.
  7. on:
  8. push:
  9. tags:
  10. - '3*.*.*'
  11. - '!3*.*.*-*'
  12. workflow_dispatch:
  13. inputs:
  14. tag:
  15. description: 'Release tag to label upgrade notes with (eg 3000.23.0)'
  16. required: true
  17. permissions:
  18. contents: read
  19. concurrency:
  20. group: release-upgrade-notes
  21. cancel-in-progress: false
  22. jobs:
  23. label-upgrade-notes:
  24. runs-on: ubuntu-latest
  25. env:
  26. NOTES_PATH: docs/modules/ROOT/pages/upgrade/upgrade_notes.adoc
  27. RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
  28. steps:
  29. - name: Checkout next
  30. uses: actions/checkout@v6
  31. with:
  32. ref: next
  33. fetch-depth: 0
  34. token: ${{ secrets.CONTAINER_TOKEN }}
  35. - name: Move released upgrade notes
  36. run: |
  37. released_notes="${RUNNER_TEMP}/upgrade_notes_released.adoc"
  38. if ! git show "refs/tags/${RELEASE_TAG}:${NOTES_PATH}" > "${released_notes}"; then
  39. echo "Tag ${RELEASE_TAG} has no ${NOTES_PATH}; nothing to do."
  40. exit 0
  41. fi
  42. python3 -I scripts/release_upgrade_notes.py "${RELEASE_TAG}" "${released_notes}" "${NOTES_PATH}"
  43. - name: Commit and push
  44. run: |
  45. if git diff --quiet -- "${NOTES_PATH}"; then
  46. echo "No changes to commit."
  47. exit 0
  48. fi
  49. git config user.name "github-actions[bot]"
  50. git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
  51. git add "${NOTES_PATH}"
  52. git commit -m "docs: label upgrade notes released in ${RELEASE_TAG}"
  53. git push origin HEAD:next