Skip to content

Commit

Permalink
Added postRelease.R
Browse files Browse the repository at this point in the history
  • Loading branch information
dklein-pik committed Oct 25, 2024
1 parent 03a579b commit 1c505b3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/start/defineInputData.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# | Contact: [email protected]
#' construct list of input data files
#' @param cfg list of configs
#' @param remindPath path to REMIND main folder

defineInputData <- function(cfg, remindPath = ".") {

Expand Down
47 changes: 47 additions & 0 deletions scripts/utils/postRelease.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
postRelease <- function() {
gert::git_fetch("upstream")
gert::git_merge("upstream/master")

pattern <- "The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)."
stopifnot(any(grepl(pattern, readLines("CHANGELOG.md"), fixed = TRUE)))
textToAdd <- paste("",
"",
"",
"## [Unreleased]",
"",
"### changed",
"-",
"",
"### added",
"-",
"",
"### removed",
"-",
"",
"### fixed",
"-",
sep = "\n")

readLines("CHANGELOG.md") |>
sub(pattern = pattern, replacement = paste0(pattern, textToAdd), fixed = TRUE) |>
writeLines("CHANGELOG.md")

readLines("CITATION.cff") |>
sub(pattern = "^(version:.*)$", replacement = "\\1dev") |>
writeLines("CITATION.cff")

citation::cff2zenodo("CITATION.cff")

message("TODO: git add -p\n",
"Press enter when done to commit, push and create PR")
gms::getLine()

gert::git_commit("merge master into develop")
gert::git_push()
system(paste0("gh pr create --base develop --title 'merge master into develop' --body ''"))
}

postRelease()
message("warnings:")
print(warnings())

0 comments on commit 1c505b3

Please sign in to comment.