Skip to content

Commit

Permalink
add release functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Apr 21, 2024
1 parent de23951 commit 103e69e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
15 changes: 11 additions & 4 deletions R/pagasa_releases.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,23 @@ paglaom_create_release_list <- function(.year = lubridate::year(Sys.Date()),
#' Create a github data release
#'

paglaom_create_weekly_release <- function(repo = "panukatan/paglaom",
tag) {
paglaom_create_weekly_release <- function(repo = "panukatan/paglaom") {
## Get release names from GitHub ----
release_names <- piggyback::pb_releases()$release_name


## Assign release name for this release ----
repeat {
release_name <- bagyo::get_bagyo()$name
if (!release_name %in% release_names) break
}

## Create tag ----
tag <- Sys.Date() |>
(\(x) x - as.numeric(format(x, "%u")))()

## Create release ----
piggyback::pb_release_create(
repo = repo, tag = tag, name = release_name
)
}
}

10 changes: 10 additions & 0 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
],
"Hash": "c39fbec8a30d23e721980b8afb31984c"
},
"bagyo": {
"Package": "bagyo",
"Version": "0.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "8a99897411c511af736da1479b942350"
},
"base64enc": {
"Package": "base64enc",
"Version": "0.1-3",
Expand Down

0 comments on commit 103e69e

Please sign in to comment.