diff --git a/R/pagasa_releases.R b/R/pagasa_releases.R index 7407a49..4a4d248 100644 --- a/R/pagasa_releases.R +++ b/R/pagasa_releases.R @@ -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 ) -} \ No newline at end of file +} + diff --git a/renv.lock b/renv.lock index 3fbad12..2307d26 100644 --- a/renv.lock +++ b/renv.lock @@ -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",