-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathconsensus-node-release-notes.yml
More file actions
153 lines (130 loc) · 5.67 KB
/
Copy pathconsensus-node-release-notes.yml
File metadata and controls
153 lines (130 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Consensus Node Release Notes
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: 'A specific version to add (e.g. 0.74.1). Leave blank to backfill every missing release.'
required: false
type: string
schedule:
# Daily at 07:15 UTC. Safety net in case no push to main happened that day.
- cron: '15 7 * * *'
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
TARGET: learn/release-notes/services.mdx
REPO: hiero-ledger/hiero-consensus-node
jobs:
add-release-notes:
runs-on: hashgraph-docs-linux-medium
steps:
- name: Harden the runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout docs repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: '22'
- name: Plan versions to add
id: plan
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_INPUT: ${{ inputs.version }}
run: |
set -euo pipefail
if [[ -n "${VERSION_INPUT}" ]]; then
# Single-version mode: validate and use exactly the requested version.
VERSION="${VERSION_INPUT#v}"
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid version: ${VERSION_INPUT}" >&2
echo "Expected X.Y.Z or vX.Y.Z, for example 0.74.1 or v0.74.1." >&2
exit 1
fi
echo "${VERSION}" > "${RUNNER_TEMP}/versions.txt"
else
# Backfill mode: every stable release newer than the latest on the page.
gh release list \
--repo "${REPO}" \
--exclude-pre-releases \
--exclude-drafts \
--limit 100 \
--json tagName \
> "${RUNNER_TEMP}/releases.json"
node .github/scripts/select-backfill-versions.js \
--target "${TARGET}" \
--releases "${RUNNER_TEMP}/releases.json" \
> "${RUNNER_TEMP}/versions.txt"
fi
COUNT="$(grep -c . "${RUNNER_TEMP}/versions.txt" || true)"
echo "count=${COUNT}" >> "${GITHUB_OUTPUT}"
if [[ "${COUNT}" -eq 0 ]]; then
echo "No missing releases — nothing to do."
else
echo "Will add $COUNT release(s):"
cat "${RUNNER_TEMP}/versions.txt"
CSV="$(sed 's/^/v/' "$RUNNER_TEMP/versions.txt" | paste -sd, -)"
echo "versions_csv=${CSV}" >> "${GITHUB_OUTPUT}"
fi
- name: Generate MDX entries
if: steps.plan.outputs.count != '0'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
# Pull network upgrade dates from the Hedera status page (used to fill
# in mainnet/testnet dates when scaffolding a new minor section).
# Non-fatal: the script falls back to TODO dates if this is missing.
curl -sSfL --max-time 30 \
https://status.hedera.com/api/v2/scheduled-maintenances.json \
> "${RUNNER_TEMP}/status.json" || echo '{}' > "${RUNNER_TEMP}/status.json"
# Oldest-first so the newest release ends up prepended last (on top).
while IFS= read -r VERSION; do
[[ -z "${VERSION}" ]] && continue
echo "::group::v${VERSION}"
gh release view "v${VERSION}" \
--repo "${REPO}" \
--json body,tagName,url \
> "${RUNNER_TEMP}/release.json"
node .github/scripts/consensus-node-release-entry.js \
--version "${VERSION}" \
--release-json "${RUNNER_TEMP}/release.json" \
--target "${TARGET}" \
--status-json "${RUNNER_TEMP}/status.json"
echo "::endgroup::"
done < "${RUNNER_TEMP}/versions.txt"
- name: Open pull request
if: steps.plan.outputs.count != '0'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: learn/release-notes/services.mdx
commit-message: "docs: add consensus node release notes (${{ steps.plan.outputs.versions_csv }})"
signoff: true
sign-commits: true
branch: automation/consensus-node-release-notes
title: "docs: consensus node release notes (${{ steps.plan.outputs.versions_csv }})"
assignees: ${{ github.actor }}
labels: automated-pr
delete-branch: true
body: |
## Consensus Node Release Notes
This PR adds the build changelog for the following consensus node releases: **${{ steps.plan.outputs.versions_csv }}**
Source: https://github.com/hiero-ledger/hiero-consensus-node/releases
### Review checklist
- [ ] Verify bullets are accurate and complete
- [ ] For any new minor release, fill in the scaffolded `## Release vX.Y` release highlights + "What's new" accordion
- [ ] Confirm the auto-filled mainnet/testnet dates are correct (or fill any left as TODO if the status page had no date yet)
- [ ] Confirm each build block landed under the correct minor section, in descending order
- [ ] Check for breaking changes that warrant a callout