Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup binary package repository for different platforms #8

Merged
merged 24 commits into from
Sep 26, 2024
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e9f2b2f
feat: setup binary package repository for different platforms
walkowif Sep 23, 2024
c9641e4
fix: remove problematic command
walkowif Sep 23, 2024
9d38090
chore: test alternative repository names
walkowif Sep 23, 2024
84e7531
fix: use pkgcache::repo_resolve
walkowif Sep 24, 2024
9c895c9
chore: cleanup old solution
walkowif Sep 24, 2024
7dafae9
chore: update R command
walkowif Sep 24, 2024
043cb1b
feat: setup multiple repositories using pkgcache
walkowif Sep 24, 2024
147eaf8
Merge branch 'setup-binary-package-repository-for-different-platforms…
walkowif Sep 24, 2024
5007e9d
fix: R flags
walkowif Sep 24, 2024
790ac25
fix: options(repos)
walkowif Sep 24, 2024
05adbe3
fix: set options(repos) in .Rprofile
walkowif Sep 24, 2024
b82f676
chore: debug resolved repositories
walkowif Sep 25, 2024
7b72361
fix: typo
walkowif Sep 25, 2024
15bc0a2
chore: print repos
walkowif Sep 25, 2024
5d09a10
fix: options(repos)
walkowif Sep 25, 2024
ad16fb0
chore: ensure libcurl is installed
walkowif Sep 25, 2024
7457fd6
chore: swap installation instructions
walkowif Sep 25, 2024
024c176
fix: install pkgcache with r-lib/actions/setup-r-dependencies
walkowif Sep 25, 2024
4fa7f3f
fix: set default repository list
walkowif Sep 25, 2024
8786283
fix: remove default_cran_mirror
walkowif Sep 25, 2024
f9ff772
Merge branch 'setup-binary-package-repository-for-different-platforms…
walkowif Sep 25, 2024
64a4407
chore: remove debug step
walkowif Sep 25, 2024
717844d
fix: use unique repos
walkowif Sep 26, 2024
7c8685b
chore: cleanup debug output
walkowif Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ inputs:
description: Maximum number of iterations to resolve dependencies.
required: false
default: 10
repository-list:
description: |
Comma-separated list of pkgcache-compatible repository names from which the dependencies will be downloaded.
required: false
default: "PPM@latest"

branding:
icon: 'download'
Expand Down Expand Up @@ -83,8 +88,19 @@ runs:
any::pkgdepends
any::cli
any::desc
any::pkgcache
install-pandoc: false

- name: Set repositories
run: |
cat > ${HOME}/.Rprofile <<EOF
repository_list <- unlist(strsplit(
"${{ inputs.repository-list }}", split=","
))
options(repos = unique(c(vapply(repository_list, pkgcache::repo_resolve, character(1)), getOption("repos"))))
EOF
shell: bash

- name: Prepare utils
id: utils
shell: Rscript {0}
Expand Down Expand Up @@ -346,21 +362,6 @@ runs:
shell: bash
run: rm utils.R

- name: Set repositories
run: |
OS_CODENAME=$(lsb_release --codename --short | tail -1)
cat > ${HOME}/.Rprofile <<EOF
options(
repos = c(
RSPM = "https://packagemanager.posit.co/cran/__linux__/${OS_CODENAME}/latest",
CRAN = "https://packagemanager.posit.co/cran/__linux__/${OS_CODENAME}/latest"
)
)
EOF
echo "Repositories written to ${HOME}/.Rprofile:"
cat ${HOME}/.Rprofile
shell: bash

- uses: r-lib/actions/setup-r-dependencies@v2
if: ${{ inputs.skip-install == 'false' }}
with:
Expand Down
Loading