submit_cran: Submit a source package to CRAN

View source: R/cran.R

submit_cranR Documentation

Submit a source package to CRAN

Description

Build a source package and submit it to CRAN with the curl package.

Usage

submit_cran(file = pkg_build(), comment = "", sync = TRUE)

Arguments

file

The path to the source package tarball. By default, the current working directory is treated as the package root directory, and automatically built into a tarball, which is deleted after submission. This means you should run xfun::submit_cran() in the root directory of a package project, unless you want to pass a path explicitly to the file argument.

comment

Submission comments for CRAN. By default, if a file ‘cran-comments.md’ exists, its content will be read and used as the comment.

sync

Whether to sync the current Git branch with the remote repository before submission.

Details

When the tarball is built automatically (the default file), you can run arbitrary code before and after the build by placing scripts named ‘build-before.*’ and ‘build-after.*’ under the package's ‘tools/’ directory (‘.R’ scripts are run via Rscript, ‘.sh’ via sh). A ‘build-before’ script can generate files that should ship in the tarball but are not kept in the source tree (e.g., download or minify assets), and the matching ‘build-after’ script (run even if the build fails) can restore the source tree afterwards.

See Also

devtools::submit_cran() does the same job, with a few more dependencies in addition to curl (such as cli); xfun::submit_cran() only depends on curl.


xfun documentation built on Oct. 16, 2026, 9:06 a.m.