This action may be used for building an R package and publishing to Posit Package Manager.
R users may find it easiest to set up scaffolding for GitHub Actions using the usethis
package.
You can import and use this GitHub Action in your project using
usethis::use_github_action(url = "https://raw.githubusercontent.com/rstudio/actions/main/examples/package-manager-publish-r.yaml", open = TRUE)
Once imported, you can adjust the settings below to match your use case.
Required Posit Package Manager URL of the instance to which packages will be published.
Required An API Token generated from the Package Manager CLI. For security reasons, this value
should be set as a GitHub Encrypted Secret and referenced
as api-token: ${{ secrets.SECRET_NAME }}
as in the example usage below.
Required Package Manager source to publish packages to.
The version of R to use to build the package. Accepts release
for the latest release, or a specific version number. Default: 'release'
Package Manager distribution to publish binary package to, for example centos7
, jammy
, or rhel8
.
Distribution should correspond to the Docker distribution in the runs-on
property of the GitHub Workflow
(e.g. runs-on: ubuntu-22.04
should use distro: jammy
). Complete list of
acceptable values can be found by running rspm list distributions
on the Package Manager server.
If input is not specified, only source package will be built.
Run R package checks, and don't publish if checks fail. Default: true
If source already contains a package with the same version, replace the existing one. Default: true
Relative path to package source directory. Defaults to root of the repo.
steps:
- uses: actions/checkout@v3
- name: Build and Publish R Package to Package Manager
uses: rstudio/actions/package-manager-publish-r@main
with:
url: http://packagemanager.example.com:4242
api-token: ${{ secrets.PPM_API_TOKEN }}
r-version: release
source: local
distro: jammy