-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcran_02_check_remotely.R
More file actions
63 lines (61 loc) · 2.2 KB
/
Copy pathcran_02_check_remotely.R
File metadata and controls
63 lines (61 loc) · 2.2 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
du <- new.env()
source(
"https://raw.githubusercontent.com/FinnishCancerRegistry/r-package-dev-scripts/refs/heads/main/utils.R",
local = du
)
## winbuilder ------------------------------------------------------------------
local({
# devtools::build(binary = FALSE, path = "dev/")
# tar_gz_file_path <- dir("dev", pattern = "[.]tar[.]gz$", full.names = TRUE)
out <- tryCatch(
{
message("Running devtools::check_win_*(webform = TRUE)")
devtools::check_win_devel(webform = TRUE, quiet = TRUE)
devtools::check_win_release(webform = TRUE, quiet = TRUE)
devtools::check_win_oldrelease(webform = TRUE, quiet = TRUE)
TRUE
},
error = function(e) e
)
if (inherits(out, "error")) {
unlink(dir("dev", pattern = "[.]tar[.]gz$", full.names = TRUE))
message(
"Automatic upload failed. ",
"Upload the created source file to this address on every R version it ",
"allows: https://win-builder.r-project.org/. ",
"Press enter when you have done that."
)
readline(": ")
} else {
message(
"Uploaded package to WinBuilder. You will receive the results to the ",
"e-mail of the maintainer."
)
}
})
## rhub ------------------------------------------------------------------------
# if this does not work, see rhub::rhub_doctor.
# I found that only the "classic" PAT works.
# If you still struggle, you can trigger this manually on the actions page
# of the github repo.
system2("git", "push")
message(
"Running rhub::rhub_check(platforms = c(\"linux\", \"windows\", \"macos\"))"
)
rhub::rhub_check(platforms = c("linux", "windows", "macos"))
message(
"The above triggered checks on Github's servers. See the actions page ",
"of the repository to see the results. ",
"Press enter to confirm that you understand."
)
readline(": ")
## cran-comments.md ------------------------------------------------------------
message(
"After winbuilder has e-mailed its passing checks and rhub checks ",
"have passed, update cran-comments.md. Press enter when you have done ",
"that."
)
du$gitignore_append("cran-comments.md")
readline(": ")
system2("git", c("add", "cran-comments.md"))
system2("git", c("commit", "--m", "\"docs: update cran-comments.md\""))