Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1926 gh release #1927

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

* `use_cpp11()` now automatically updates the `NAMESPACE` (@pachadotdev, #1921).

* `use_github_release()` gains two arguments: `prerelease` and
`generate_release_notes` argument to identify releases as a prerelease and
automatically generate additional release notes from commits, respectively
(@jmbarbone, #1926).

# usethis 2.2.2

* Implicit usage of `numeric_version()` via comparison now always provides
Expand Down
15 changes: 11 additions & 4 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ release_type <- function(version) {

#' Publish a GitHub release
#'
#' @description
#' Pushes the current branch (if safe) then publishes a GitHub release for the
#' latest CRAN submission.
#' @description Pushes the current branch (if safe) then publishes a GitHub
#' release for the latest CRAN submission.
#'
#' If you use [devtools::submit_cran()] to submit to CRAN, information about the
#' submitted state is captured in a `CRAN-SUBMISSION` file.
Expand All @@ -230,8 +229,14 @@ release_type <- function(version) {
#' a URL determined from the current project's GitHub remotes.
#' @param publish If `TRUE`, publishes a release. If `FALSE`, creates a draft
#' release.
#' @param prerelease If `TRUE` identify the release as a prerelease.
#' @param generate_release_notes If `TRUE`, the body will be append with
#' automatically generated notes.
#'
#' @export
use_github_release <- function(publish = TRUE,
prerelease = FALSE,
generate_release_notes = FALSE,
host = deprecated(),
auth_token = deprecated()) {
check_is_package("use_github_release()")
Expand Down Expand Up @@ -269,7 +274,9 @@ use_github_release <- function(publish = TRUE,
tag_name = tag_name,
target_commitish = dat$SHA,
body = news,
draft = !publish
draft = !publish,
prerelease = prerelease,
generate_release_notes = generate_release_notes
)
ui_cli_inform("Release at {.url {release$html_url}}")

Expand Down
11 changes: 9 additions & 2 deletions man/use_github_release.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading