Notes on setting up this GitHub repository, including R command
history.
Initial Setup
Create the GitHub repository from the RStudio console, with no
project open: “Project: (none)”
create_github_repo(
"siracon2022",
repo_desc = 'Notebooks for my SiRAcon 2022 presentation, "Making R work for you (with automation!)"'
)
On macOS, the automation will open the repository in GitHub Desktop,
RStudio, and open the repository settings on github.com in the default
browser.
Package Setup
Set up the package as an R
Analysis Package. First run rdev::use_rdev_package()
to
add the common package conventions I use.
The remaining commands are run from the RStudio console with the new
project open: “siracon2022”
gert::git_branch_create("package-setup")
gert::git_add(".")
gert::git_commit("rdev::create_github_repo()")
gert::git_push()
rdev::use_rdev_package()
After rdev::use_rdev_package()
is run, the R Session
will automatically restart after renv::init()
completes.
To complete setup, commands are run to:
- Change the package to the R Analysis Package format
- Add spell checks
- Delete test-package.R (which is no longer needed)
- Check dependencies, tests, and continuous integration
- Open key files for editing in RStudio
gert::git_add(".")
gert::git_commit("rdev::use_rdev_package()")
gert::git_push()
# 1
use_analysis_package()
gert::git_add(".")
gert::git_commit("rdev::use_analysis_package()")
gert::git_push()
# 2
use_spelling()
gert::git_add(".")
gert::git_commit("rdev::use_spelling()")
gert::git_push()
# 3
fs::file_delete("tests/testthat/test-package.R")
gert::git_add(".")
gert::git_commit("remove obsolete test-package.R")
gert::git_push()
# 4
check_renv()
test()
ci()
# 5
file.edit("TODO.md", "NEWS.md", "README.Rmd", "DESCRIPTION", ".gitignore")
Manual Updates
Final package setup is done manually. A summary of git commits is
listed in the table below.
Update .gitignore |
Add line breaks (not automated yet) |
Fix spell_check_notebooks() test |
Fix a bug in tests/testthat/test-spelling.R (also fixed
in rdev) |
renv::update() |
Save updated packages after running
rdev::check_renv and renv::snapshot |
Update DESCRIPTION |
Update Title and Description. Also add fs, purrr from
README.Rmd to Suggests (also fixed in rdev). |
Add SiRAcon 2022 Setup Log Notebook |
Added SiRAcon 2022 Setup Log Notebook |
renv::update() |
Update rdev package (with new bug fixes) |
Add siracon2022 0.1.0 release notes |
Add release notes for initial development release |
Final setup-log updates |
Add final updates to setup-log.Rmd before release |
Switch from HEAD to default branch |
renv works better with the RemoteRef in renv.lock set
to the default branch. To fix this, I ran
renv::install(c("r-lib/lintr","jabenninghoff/rdev")) . |
Since stage_release()
calls
build_analysis_site()
, which currently requires at least
one notebook in the analysis directory, we add the first notebook before
running the release automation scripts:
get_release()
stage_release()
# validate that all pull request checks (GitHub Actions) pass
merge_release()
The automation scripts automatically create the release and GitHub
pages site, including the following commits:
- GitHub release 0.1.0
- build_analysis_site() for release 0.1.0
The site can now be accessed at https://jabenninghoff.github.io/siracon2022/ !
Continue Development
From here, we continue development and release as needed. The first
step is to create a new branch:
new_branch("analysis-updates")
Feel free to browse the commit
history to see progress towards the 1.0 release prior to
SiRAcon.
LS0tCnRpdGxlOiBTaVJBY29uIDIwMjIgU2V0dXAgTG9nCmF1dGhvcjogSm9obiBCZW5uaW5naG9mZgpkYXRlOiAnMjAyMi0wNC0yNCcKZGF0ZS1tb2RpZmllZDogJzIwMjItMDQtMzAnCmNhdGVnb3JpZXM6IFtdCm9yZGVyOiB+Cm91dHB1dDoKICBodG1sX2RvY3VtZW50OgogICAgdGhlbWU6CiAgICAgIHZlcnNpb246IDUKICAgICAgcHJlc2V0OiBib290c3RyYXAKICAgIGNzczogYXNzZXRzL2V4dHJhLmNzcwogICAgcGFuZG9jX2FyZ3M6IC0tc2hpZnQtaGVhZGluZy1sZXZlbC1ieT0xCiAgICB0b2M6IHllcwogICAgdG9jX2Zsb2F0OgogICAgICBjb2xsYXBzZWQ6IG5vCiAgICAgIHNtb290aF9zY3JvbGw6IG5vCi0tLQoKTm90ZXMgb24gc2V0dGluZyB1cCB0aGlzIEdpdEh1YiByZXBvc2l0b3J5LCBpbmNsdWRpbmcgUiBjb21tYW5kIGhpc3RvcnkuCgojIEluaXRpYWwgU2V0dXAKCkNyZWF0ZSB0aGUgR2l0SHViIHJlcG9zaXRvcnkgZnJvbSB0aGUgUlN0dWRpbyBjb25zb2xlLCB3aXRoIG5vIHByb2plY3Qg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