|
1 | 1 | #' Release package to CRAN. |
2 | 2 | #' |
3 | | -#' Run automated and manual tests, then post package to CRAN. |
4 | | -#' |
5 | | -#' The package release process will: |
6 | | -#' |
7 | | -#' * Confirm that the package passes `R CMD check` on relevant platforms |
8 | | -#' * Confirm that important files are up-to-date |
9 | | -#' * Build the package |
10 | | -#' * Submit the package to CRAN, using comments in "cran-comments.md" |
| 3 | +#' @description |
| 4 | +#' `r lifecycle::badge("deprecated")` |
11 | 5 | #' |
12 | | -#' You can add arbitrary extra questions by defining an (un-exported) function |
13 | | -#' called `release_questions()` that returns a character vector |
14 | | -#' of additional questions to ask. |
| 6 | +#' `release()` is deprecated in favour of [usethis::use_release_issue()]. |
| 7 | +#' We no longer feel confident recommending `release()` because we don't use it |
| 8 | +#' ourselves, so there's no guarantee that it will track best practices as |
| 9 | +#' they evolve over time. |
15 | 10 | #' |
16 | | -#' You also need to read the CRAN repository policy at |
17 | | -#' 'https://cran.r-project.org/web/packages/policies.html' and make |
18 | | -#' sure you're in line with the policies. `release` tries to automate as |
19 | | -#' many of polices as possible, but it's impossible to be completely |
20 | | -#' comprehensive, and they do change in between releases of devtools. |
| 11 | +#' If you want to programmatical submit to CRAN, you can continue to use |
| 12 | +#' [submit_cran()]. |
21 | 13 | #' |
22 | 14 | #' @template devtools |
23 | 15 | #' @param check if `TRUE`, run checking, otherwise omit it. This |
|
29 | 21 | #' tasks that you can use in addition to or in place of `release`. |
30 | 22 | #' @export |
31 | 23 | release <- function(pkg = ".", check = FALSE, args = NULL) { |
| 24 | + lifecycle::deprecate_warn( |
| 25 | + "2.5.0", |
| 26 | + "release()", |
| 27 | + "usethis::use_release_issue()" |
| 28 | + ) |
| 29 | + if (!rlang::is_interactive()) { |
| 30 | + cli::cli_abort("Interactive session required.") |
| 31 | + } |
| 32 | + |
32 | 33 | pkg <- as.package(pkg) |
33 | 34 | # Figure out if this is a new package |
34 | 35 | cran_version <- cran_pkg_version(pkg$package) |
@@ -159,6 +160,10 @@ find_release_questions <- function(pkg = ".") { |
159 | 160 | } |
160 | 161 |
|
161 | 162 | yesno <- function(msg, .envir = parent.frame()) { |
| 163 | + if (!rlang::is_interactive()) { |
| 164 | + cli::cli_abort("Called from non-interactive context.") |
| 165 | + } |
| 166 | + |
162 | 167 | yeses <- c( |
163 | 168 | "Yes", |
164 | 169 | "Definitely", |
@@ -226,23 +231,13 @@ cran_submission_url <- "https://xmpalantir.wu.ac.at/cransubmit/index2.php" |
226 | 231 | #' Submit a package to CRAN |
227 | 232 | #' |
228 | 233 | #' @description |
229 | | - |
230 | 234 | #' This submits your package to CRAN using the web-form submission process. |
231 | | -#' After submission, you will receive an email asking you to confirm submission |
232 | | -#' - this is used to check that the package is submitted by the maintainer. |
233 | | -#' |
234 | | -#' You may prefer to use `submit_cran()` indirectly, by calling [release()] |
235 | | -#' instead. `release()` performs many checks verifying that your package is |
236 | | -#' indeed ready for CRAN, before eventually asking for your confirmation that |
237 | | -#' you'd like to submit it to CRAN (which it does by calling `submit_cran()`). |
| 235 | +#' To complete the submission you will need respond to the email sent to the |
| 236 | +#' maintainer email address. |
238 | 237 | #' |
239 | | -#' Whether to use `release()` or `submit_cran()` depends on the rest of your |
240 | | -#' development process. If you want to be super cautious, use `release()`, even |
241 | | -#' though it may be redundant with other checks you have performed. On the other |
242 | | -#' hand, if you have many other checks in place (such as automated checks via |
243 | | -#' GitHub Actions and the task list generated by |
244 | | -#' [usethis::use_release_issue()]), it makes sense to use `submit_cran()` |
245 | | -#' directly. |
| 238 | +#' We generally recommend using this part of the process defined by |
| 239 | +#' [use_release_issue()]; this process maximizes the chances of a successful |
| 240 | +#' submission. |
246 | 241 | #' |
247 | 242 | #' @template devtools |
248 | 243 | #' @inheritParams release |
|
0 commit comments