-
Notifications
You must be signed in to change notification settings - Fork 2
/
ReleaseScheduling.R
196 lines (173 loc) · 6.04 KB
/
ReleaseScheduling.R
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
## Release scheduler
prefix <- "$HOME/scripts"
crontabline <- function(T, hr, min, prg, ...)
{
lT <- as.POSIXlt(T)
m <- lT$mon+1
d <- lT$mday
timing <- paste(min, hr, d, m, "*")
prg <- paste(prefix, prg, sep="/")
cmd <- paste(prg, paste(shQuote(c(...)), collapse=" "))
paste(timing, cmd)
}
Sc <- function(what, when) cat(what, strftime(when, "%a %F\n"))
Dt <- function(when) strftime(when, "%A %F")
Dt_ <- function(when) strftime(when, "%F")
DoSubst <- function(blurb, ...)
{
l <- list(...)
patterns <- sprintf("@%s@", names(l))
for (i in seq_along(l))
blurb <- gsub(patterns[[i]], l[[i]], blurb, fixed=TRUE)
blurb
}
SchedulePatchRelease <- function(date, Version, Nick, fast=FALSE)
{
T <- as.Date(date)
T_remind <- T - if (fast) 8 else 12
T_beta <- T - if (fast) 7 else 10
T_RC <- T - if (fast) 3 else 7
cat("\nKey Dates:\n")
Sc("START\t\t\t", T_beta)
Sc("CODE FREEZE\t\t", T_RC)
Sc("RELEASE\t\t\t", T)
remind <- crontabline(T_remind, "00", "02",
"R-remind-CRAN",
paste("Update directory for version", Version))
beta <- crontabline(T_beta, "00", "02",
"R-set-version", paste(Version, "beta"), Nick)
fixNEWS <- crontabline(T_beta, "00", "04",
"R-fixup-NEWS", Version)
RC <- crontabline(T_RC, "00", "02",
"R-set-version", paste(Version, "RC"))
final <- crontabline(T, "09", "00", "R-build-dist", Version)
cat("\nCrontab Entries:\n")
cat(remind, beta, fixNEWS, RC, final, sep="\n")
cat("\nEntry for R-dev-web index.html\n")
blurb <- "
<p>The release of @VERSION@ (\"@NICK@\") is
scheduled for @RELEASE@.
Release candidate tarballs will be made available
during the week up to the release.
<p> Please refer to the
<a href=\"release-checklist.html\">generic checklist</a> for details
<ul>
<li>@START@: <i>START</i> (@VERSION@ beta)
<li>@CODEFREEZE@: <i>CODE FREEZE</i> (@VERSION@ RC)
<li>@RELEASE@: <i>RELEASE</i> (@VERSION@)
</ul>
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
START=Dt(T_beta),
CODEFREEZE=Dt(T_RC),
RELEASE=Dt(T)
))
cat("\nEntry for R-project web md/index.md\n")
blurb <- "
- [**R version @VERSION@ (@NICK@) prerelease versions**](http://cran.r-project.org/src/base-prerelease) will appear starting @START@. Final release is scheduled for @RELEASE@.
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
START=Dt(T_beta),
CODEFREEZE=Dt(T_RC),
RELEASE=Dt(T)
))
cat("\nEntries for ~/R-release/VERSION-INFO.dcf\n")
cat("Edit file, then:\n")
cat("rsync -aOvuz --no-p --exclude='*~' ~/R-release/ cran.r-project.org:/srv/ftp/pub/R/src/base\n")
blurb <- "
Next-release: @VERSION@
Next-nick: @NICK@
Next-date: @RELEASE@
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
RELEASE=Dt_(T)
))
}
ScheduleRegularRelease <- function(date, Version, Nick)
{
T <- as.Date(date)
cat("\nKey Dates:\n")
Sc("START\t\t\t", T-31)
Sc("GRAND-FEATURE FREEZE\t", T - 28)
Sc("FEATURE FREEZE\t\t", T - 14)
Sc("CODE FREEZE\t\t", T - 7)
Sc("RELEASE\t\t\t", T)
Version0 <- gsub("\\.0$", "", Version)
VersionP <- gsub("\\.0$", "-patched", Version)
remind <- crontabline(T-31, "00", "02",
"R-remind-CRAN",
"Set up directories for the new R-devel")
branch <- crontabline(T-28, "00", "02", "R-create-branch", Version0)
fixNEWS <- crontabline(T-28, "00", "10",
"R-fixup-NEWS", Version)
beta <- crontabline(T-14, "00", "02",
"R-set-version", paste(Version, "beta"), Nick)
RC <- crontabline(T-7, "00", "02",
"R-set-version", paste(Version, "RC"))
remind2 <- crontabline(T-3, "00", "02",
"R-remind-CRAN",
paste("Set up directory for", VersionP))
final <- crontabline(T, "09", "00", "R-build-dist", Version)
cat("\nCrontab Entries:\n")
cat(remind, branch, fixNEWS, beta, RC, remind2, final, sep="\n")
cat("\nEntry for R-dev-web index.html\n")
blurb <- "
<p>The release of @VERSION@ (\"@NICK@\") is
scheduled for @RELEASE@. Prerelease
source tarballs (and binaries for some platforms) are being made
available during the 4 weeks until the release.
<p>The schedule for @VERSION@ is as follows
<ul>
<li>@START@: <i>START</i>
<li>@GRANDFEATUREFREEZE@: <i>GRAND-FEATURE FREEZE</i> (@VERSION@ alpha) </li>
<li>@FEATUREFREEZE@: <i>FEATURE FREEZE</i> (@VERSION@ beta) </li>
<li>@CODEFREEZE@: <i>CODE FREEZE</i> (@VERSION@ RC) </li>
<li>@PRERELEASE@: <i>PRERELEASE</i></li>
<li>@RELEASE@: <i>RELEASE</i> (@VERSION@) </li>
</ul>
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
START=Dt(T-31),
GRANDFEATUREFREEZE=Dt(T-28),
FEATUREFREEZE=Dt(T-14),
CODEFREEZE=Dt(T-7),
PRERELEASE=Dt(T-3),
RELEASE=Dt(T)
))
cat("\nEntry for R-project web md/index.md\n")
blurb <- "
- [**R version @VERSION@ (@NICK@) prerelease versions**](http://cran.r-project.org/src/base-prerelease) will appear starting @START@. Final release is scheduled for @RELEASE@.
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
START=Dt(T-31),
GRANDFEATUREFREEZE=Dt(T-28),
FEATUREFREEZE=Dt(T-14),
CODEFREEZE=Dt(T-7),
RELEASE=Dt(T)
))
cat("\nEntries for ~/R-release/VERSION-INFO.dcf\n")
cat("Edit file, then:\n")
cat("rsync -aOvuz --no-p --exclude='*~' ~/R-release/ cran.r-project.org:/srv/ftp/pub/R/src/base\n")
blurb <- "
Next-release: @VERSION@
Next-nick: @NICK@
Next-date: @RELEASE@
"
cat(DoSubst(blurb,
VERSION=Version,
NICK=Nick,
RELEASE=Dt_(T)
))
}
SchedulePatchRelease("2023-10-31", "4.3.2", "Eye Holes", fast=FALSE)
#ScheduleRegularRelease("2023-04-21", "4.3.0", "Already Tomorrow")