@@ -8,41 +8,34 @@ set -euo pipefail
8
8
9
9
DOCS_FILE=" docs/install/releases/index.md"
10
10
11
- # Define unique markdown comments as anchors
12
11
CALENDAR_START_MARKER=" <!-- RELEASE_CALENDAR_START -->"
13
12
CALENDAR_END_MARKER=" <!-- RELEASE_CALENDAR_END -->"
14
13
15
- # Get current date
16
14
current_date=$( date +" %Y-%m-%d" )
17
15
current_month=$( date +" %m" )
18
16
current_year=$( date +" %Y" )
19
17
20
- # Function to get the first Tuesday of a given month and year
21
18
get_first_tuesday () {
22
19
local year=$1
23
20
local month=$2
24
21
local first_day
25
22
local days_until_tuesday
26
23
local first_tuesday
27
24
28
- # Find the first day of the month
29
25
first_day=$( date -d " $year -$month -01" +" %u" )
30
26
31
- # Calculate days until first Tuesday (if day 1 is Tuesday, first_day=2)
32
27
days_until_tuesday=$(( first_day == 2 ? 0 : (9 - first_day) % 7 ))
33
28
34
- # Get the date of the first Tuesday
35
29
first_tuesday=$( date -d " $year -$month -01 +$days_until_tuesday days" +" %Y-%m-%d" )
36
30
37
31
echo " $first_tuesday "
38
32
}
39
33
40
- # Function to format date as "Month DD, YYYY"
34
+ # Format date as "Month DD, YYYY"
41
35
format_date () {
42
36
date -d " $1 " +" %B %d, %Y"
43
37
}
44
38
45
- # Function to get the latest patch version for a minor release
46
39
get_latest_patch () {
47
40
local version_major=$1
48
41
local version_minor=$2
@@ -52,19 +45,15 @@ get_latest_patch() {
52
45
# Get all tags for this minor version
53
46
tags=$( cd " $( git rev-parse --show-toplevel) " && git tag | grep " ^v$version_major \\ .$version_minor \\ ." | sort -V)
54
47
55
- # Get the latest one
56
48
latest=$( echo " $tags " | tail -1)
57
49
58
50
if [ -z " $latest " ]; then
59
- # If no tags found, return empty
60
51
echo " "
61
52
else
62
- # Return without the v prefix
63
53
echo " ${latest# v} "
64
54
fi
65
55
}
66
56
67
- # Function to get the next release month, accounting for skipped January releases
68
57
get_next_release_month () {
69
58
local current_month=$1
70
59
local next_month=$(( current_month + 1 ))
@@ -103,13 +92,9 @@ generate_release_calendar() {
103
92
# Start with 3 unsupported releases back
104
93
start_minor=$(( version_minor - 5 ))
105
94
106
- # Initialize the calendar table with an additional column for latest release
107
95
result=" | Release name | Release Date | Status | Latest Release |\n"
108
96
result+=" |--------------|--------------|--------|----------------|\n"
109
97
110
- # We know we skip January in our release schedule
111
- # Months when releases happen (Feb-Dec, skip Jan)
112
-
113
98
# Find the latest release month and year
114
99
local current_release_minor=$(( version_minor - 1 )) # Current stable release
115
100
local tag_date
0 commit comments