release-upgrade-notes.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # A run that is waiting must not be replaced by a later one, or the notes for
  20. # the earlier tag would be moved under the later version instead.
  21. concurrency:
  22. group: release-upgrade-notes
  23. cancel-in-progress: false
  24. queue: max
  25. jobs:
  26. label-upgrade-notes:
  27. runs-on: ubuntu-latest
  28. env:
  29. NOTES_PATH: docs/modules/ROOT/pages/upgrade/upgrade_notes.adoc
  30. RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
  31. steps:
  32. - name: Checkout next
  33. uses: actions/checkout@v6
  34. with:
  35. ref: next
  36. fetch-depth: 0
  37. token: ${{ secrets.CONTAINER_TOKEN }}
  38. - name: Move released upgrade notes
  39. run: |
  40. released_notes="${RUNNER_TEMP}/upgrade_notes_released.adoc"
  41. if ! git show "refs/tags/${RELEASE_TAG}:${NOTES_PATH}" > "${released_notes}"; then
  42. echo "Tag ${RELEASE_TAG} has no ${NOTES_PATH}; nothing to do."
  43. exit 0
  44. fi
  45. python3 -I scripts/release_upgrade_notes.py "${RELEASE_TAG}" "${released_notes}" "${NOTES_PATH}"
  46. - name: Commit and push
  47. run: |
  48. if git diff --quiet -- "${NOTES_PATH}"; then
  49. echo "No changes to commit."
  50. exit 0
  51. fi
  52. git config user.name "github-actions[bot]"
  53. git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
  54. git add "${NOTES_PATH}"
  55. git commit -m "docs: label upgrade notes released in ${RELEASE_TAG}"
  56. git push origin HEAD:next