Skip to content

Commit

Permalink
Tweak use_github_release() so it can come before use_news_md() (r-lib…
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Feb 8, 2021
1 parent 75a0f8f commit 14c7e63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ release_checklist <- function(version, on_cran) {
"Wait for CRAN...",
"",
todo("Accepted :tada:"),
todo("`usethis::use_news_md()`", !has_news),
todo("`usethis::use_github_release()`"),
todo("`usethis::use_news_md()`", !has_news),
todo("`usethis::use_dev_version()`"),
todo("Update install instructions in README", !on_cran),
todo("Finish blog post", type != "patch"),
Expand Down Expand Up @@ -156,16 +156,18 @@ use_github_release <- function(host = deprecated(),
)
check_branch_pushed()

path <- proj_path("NEWS.md")
if (!file_exists(path)) {
ui_stop("{ui_path('NEWS.md')} not found")
}

cran_release <- proj_path("CRAN-RELEASE")
if (file_exists(cran_release)) {
file_delete(cran_release)
}
news <- news_latest(read_utf8(path))

path <- proj_path("NEWS.md")
if (file_exists(path)) {
news <- news_latest(read_utf8(path))
} else {
news <- "Initial release"
}

package <- package_data()

gh <- gh_tr(tr)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
Wait for CRAN...
* [ ] Accepted :tada:
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_github_release()`
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_dev_version()`
* [ ] Update install instructions in README
* [ ] Finish blog post
Expand Down Expand Up @@ -62,8 +62,8 @@
Wait for CRAN...
* [ ] Accepted :tada:
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_github_release()`
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_dev_version()`

---
Expand Down Expand Up @@ -92,8 +92,8 @@
Wait for CRAN...
* [ ] Accepted :tada:
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_github_release()`
* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_dev_version()`
* [ ] Finish blog post
* [ ] Tweet
Expand Down

0 comments on commit 14c7e63

Please sign in to comment.