Skip to content

Commit

Permalink
Update rstudio URLs to Posit
Browse files Browse the repository at this point in the history
Set `"RSPM_ROOT"` env variable

Fixes Setup Package fail carpentries#74
See also r-lib/remotes@e199c1b

(cherry picked from commit 7dd3bdd)

Fix posit url

Co-authored-by: Toby Hodges <[email protected]>

Empty commit to verify

Fix Posit URLs
  • Loading branch information
milanmlft authored and froggleston committed May 23, 2023
1 parent 646f8b8 commit 2519623
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions setup-lesson-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ runs:
if (on_linux) {
if (Sys.getenv("RSPM") == "") {
release <- system("lsb_release -c | awk '{print $2}'", intern = TRUE)
Sys.setenv("RSPM" =
paste0("https://packagemanager.rstudio.com/all/__linux__/", release, "/latest"))
Sys.setenv("RSPM" =
paste0("https://packagemanager.posit.co/all/__linux__/", release, "/latest"))
}
}
repos <- list(
RSPM = Sys.getenv("RSPM"),
carpentries = "https://carpentries.r-universe.dev/",
archive = "https://carpentries.github.io/drat/",
CRAN = "https://cran.rstudio.com"
CRAN = "https://cran.posit.co"
)
options(pak.no_extra_messages = TRUE, repos = repos)
cat("Repositories Used")
Expand All @@ -57,8 +57,8 @@ runs:
req("renv")
req("remotes")
rmts <- asNamespace("remotes")
# extract the function
sov <- rmts$supported_os_versions
# extract the function
sov <- rmts$supported_os_versions
# if 22.04 is not present, we need to modify the function
if (!grepl("22.04", body(sov)[2])) {
unlockBinding("supported_os_versions", rmts)
Expand All @@ -76,6 +76,7 @@ runs:
file.rename("DESCRIPTION", "DESCRIPTION.bak")
}
Sys.setenv("RENV_PROFILE" = "lesson-requirements")
Sys.setenv("RSPM_ROOT" = "https://packagemanager.posit.co")
vise::lock2desc(renv::paths$lockfile(), desc = "${{ github.workspace }}/DESCRIPTION")
writeLines(readLines("${{ github.workspace }}/DESCRIPTION"))
vise::ci_sysreqs(renv::paths$lockfile(), execute = TRUE)
Expand All @@ -89,15 +90,15 @@ runs:
if (on_linux) {
if (Sys.getenv("RSPM") == "") {
release <- system("lsb_release -c | awk '{print $2}'", intern = TRUE)
Sys.setenv("RSPM" =
paste0("https://packagemanager.rstudio.com/all/__linux__/", release, "/latest"))
Sys.setenv("RSPM" =
paste0("https://packagemanager.posit.co/all/__linux__/", release, "/latest"))
}
}
repos <- list(
RSPM = Sys.getenv("RSPM"),
carpentries = "https://carpentries.r-universe.dev/",
archive = "https://carpentries.github.io/drat/",
CRAN = "https://cran.rstudio.com"
CRAN = "https://cran.posit.co"
)
Sys.unsetenv("RENV_CONFIG_REPOS_OVERRIDE")
options(pak.no_extra_messages = TRUE, repos = repos)
Expand All @@ -109,7 +110,7 @@ runs:
cat("::group::Fortify local {renv} packages\n")
wd <- '${{ github.workspace }}'
req <- function(pkg) {
if (!requireNamespace(pkg, quietly = TRUE))
if (!requireNamespace(pkg, quietly = TRUE))
install.packages(pkg)
}
if (file.exists("DESCRIPTION")) {
Expand Down

0 comments on commit 2519623

Please sign in to comment.