--- name: Release upgrade notes # Upgrade notes for merged but unreleased changes live under # "Next release (unreleased)" in upgrade_notes.adoc. When a 3k release is # tagged, move the notes that shipped in it under a heading for that version # on the next branch, which is where docs.olivetin.app is built from. on: push: tags: - '3*.*.*' - '!3*.*.*-*' workflow_dispatch: inputs: tag: description: 'Release tag to label upgrade notes with (eg 3000.23.0)' required: true permissions: contents: read # A run that is waiting must not be replaced by a later one, or the notes for # the earlier tag would be moved under the later version instead. concurrency: group: release-upgrade-notes cancel-in-progress: false queue: max jobs: label-upgrade-notes: runs-on: ubuntu-latest env: NOTES_PATH: docs/modules/ROOT/pages/upgrade/upgrade_notes.adoc RELEASE_TAG: ${{ inputs.tag || github.ref_name }} steps: - name: Checkout next uses: actions/checkout@v6 with: ref: next fetch-depth: 0 token: ${{ secrets.CONTAINER_TOKEN }} # Runs are queued in the order they start waiting, not in tag order, so # this run may start before the run for an earlier release. Every # release up to this one is processed oldest first, so a note always # moves under the first release that shipped it. Releases that already # have a section are skipped by the script. - name: Move released upgrade notes run: | released_notes="${RUNNER_TEMP}/upgrade_notes_released.adoc" release_tags="$(git tag -l '3*.*.*' | grep -v -e '-' | sort -V)" if [[ "${RELEASE_TAG}" == *$'\n'* ]] || ! grep -qxF -- "${RELEASE_TAG}" <<< "${release_tags}"; then echo "Tag ${RELEASE_TAG} does not exist or is not a stable 3k release tag." exit 1 fi while read -r tag; do if ! git show "refs/tags/${tag}:${NOTES_PATH}" > "${released_notes}" 2>/dev/null; then echo "Tag ${tag} has no ${NOTES_PATH}; skipping." else python3 -I scripts/release_upgrade_notes.py "${tag}" "${released_notes}" "${NOTES_PATH}" fi if [ "${tag}" = "${RELEASE_TAG}" ]; then break fi done <<< "${release_tags}" - name: Commit and push run: | if git diff --quiet -- "${NOTES_PATH}"; then echo "No changes to commit." exit 0 fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add "${NOTES_PATH}" git commit -m "docs: label upgrade notes released up to ${RELEASE_TAG}" git push origin HEAD:next