make it simpler to add exceptions for future off-schedule releases

Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
Brian Phillips
2024-04-05 07:28:13 -05:00
parent f1cbcb3b94
commit f4aed165d2
+6 -3
View File
@@ -57,14 +57,17 @@ function getReleaseSchedule() {
const firstReleaseYear = 2022;
const firstReleaseMonth = 2;
// for any releases that are off schedule (i.e. v1.25.0 was released
// in the same month as v1.24.0), we need to adjust the release date
const offScheduleReleases = [25];
return Array(100)
.fill(0)
.map((_, i) => {
// the 1.24 and 1.25 releases were both released in March 2024
const modifier = i >= 25 ? -1 : 0;
const modifier = offScheduleReleases.filter(v => i >= v).length;
const date = getReleaseOfMonth(
firstReleaseYear,
firstReleaseMonth + i + modifier,
firstReleaseMonth + i - modifier,
);
return { version: `1.${i}.0`, date };
});