Skip to contents

Open a GitHub pull request for a new release from NEWS.md. Approve with approve_release(). Merge and create the release using merge_release().

Usage

stage_release(pkg = ".", filename = "NEWS.md", host = getOption("rdev.host"))

Arguments

pkg

path to package. Currently, only pkg = "." is supported.

filename

name of file containing release notes, defaults to NEWS.md.

host

GitHub host to target, passed to the .api_url argument of gh::gh(). If unspecified, gh defaults to "https://api.github.com", although gh's default can be customised by setting the GITHUB_API_URL environment variable.

For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.

Value

results of GitHub pull request, invisibly

Details

When run, stage_release():

  1. Extracts release version and release notes from NEWS.md using get_release()

  2. Validates version conforms to rdev conventions (#.#.#) and release notes aren't empty

  3. Verifies that version tag doesn't already exist using gert::git_tag_list()

  4. Checks for uncommitted changes and stops if any exist using gert::git_status()

  5. Stops if on the default branch (gert::git_branch() == usethis::git_default_branch())

  6. Updates the remote branch with gert::git_push()

  7. Opens a pull request with the title "<package> <version>" and the release notes in the body using gh::gh()

stage_release() will open the pull request in the default browser when running interactively.

Host

Set the rdev.host option when using a GitHub Enterprise server: options(rdev.host = "https://github.example.com/api/v3")