Skip to content

Commit

Permalink
enh: update GiottoData when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed May 28, 2024
1 parent c58e6d2 commit b3ac490
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,47 @@ jobs:
_R_CHECK_RD_XREFS: false
with:
dependencies: '"hard"' # do not use suggested dependencies
extra-packages: any::pkgdown, local::.
extra-packages: any::pkgdown, any::utils, local::.
needs: website

- name: Set up dependencies (GiottoData)
run: |
new_github_ver_avail <- function(
url, current_ver = NULL
) {
# Return NULL if any warnings or errors due to inaccessible
descfile <- tryCatch(
expr = readLines(url),
warning = function(w) NULL,
error = function(e) NULL
)
# silently return NULL if not found
if (is.null(descfile)) return(invisible())
# parse github version number
gh_ver <- descfile[grep(pattern = "Version:", descfile)]
gh_ver <- gsub(pattern = "Version: ", replacement = "", gh_ver)
# see if GH version is newer
ver_compare <- utils::compareVersion(gh_ver, as.character(current_ver))
# silently return NULL if not newer
if (ver_compare != 1) return(invisible())
# return newer version number
return(gh_ver)
}
new_gdata <- new_github_ver_avail(
url = "https://raw.githubusercontent.com/drieslab/GiottoData/master/DESCRIPTION",
current_ver = packageVersion("GiottoData")
)
suppressWarnings({
if (!is.null(new_gdata))
remotes::install_github('drieslab/GiottoData', build = FALSE)
})
shell: Rscript {0}

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
Expand Down

0 comments on commit b3ac490

Please sign in to comment.