Skip to content

Commit

Permalink
Split out post-cran-release
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjonesd committed Oct 2, 2024
1 parent 25717e3 commit cc21f86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 40 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ logo\.xcf
^build-cran.R$
^_pkgdown.yml$
^build-website.R$
^post-cran-release.R$
^check-reverse-dependencies.R$
^man-roxygen$
^TODO\.md$
Expand Down
40 changes: 0 additions & 40 deletions build-cran.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,47 +93,7 @@ tag(repository('.'), newtag, message = paste('CRAN release candidate for', v))
system2('git', c('push', '--tags'))



# now release!

devtools::release()




# Alternatively:
# Uncomment !CRAN lines in huxtable vignette and save
system("mkdir -p inst/doc")
devtools::build_vignettes()
# Copy built vignettes from doc/ to inst/doc:
system("cp doc/* inst/doc")
# Comment out !CRAN lines in huxtable vignette and save
# copy to inst/doc:
system("cp vignettes/huxtable.Rmd inst/doc")
# Do this to avoid R CMD check spotting newer files in vignettes than inst/doc:
system("touch inst/doc/*")
# Ensure there's a vignette index in build/vignettes.rds
# NB NOT Meta/vignettes.rds! devtools::build_vignettes() will put it there,
# you can move it
system("mv Meta/vignette.rds build")
system("rmdir Meta")
# Build a version for CRAN:
pkgbuild::build(clean_doc = FALSE, manual = TRUE, vignettes = FALSE)
# Check you have build/vignettes.rds in the tarfile
system("tar -ztvf ../huxtable_x.y.z.tar.gz | grep build")
# Submit via web form. (You could also run through the devtools::release()
# questions just to be safe!)

# after release:
revdepcheck::revdep_reset()
v <- devtools::as.package('.')$version
newtag <- paste0('v', v, '-rc')
tags <- git2r::tags()
tags <- grep(newtag, names(tags), fixed = TRUE, value = TRUE)
tags <- sort(tags)
stopifnot(length(tags) > 0)
tag <- tags[length(tags)]
gh::gh("POST /repos/hughjonesd/huxtable/releases",
name = v,
tag_name = tag,
body = sprintf("Version %s on CRAN", v))
14 changes: 14 additions & 0 deletions post-cran-release.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


revdepcheck::revdep_reset()
v <- devtools::as.package('.')$version
newtag <- paste0('v', v, '-rc')
tags <- git2r::tags()
tags <- grep(newtag, names(tags), fixed = TRUE, value = TRUE)
tags <- sort(tags)
stopifnot(length(tags) > 0)
tag <- tags[length(tags)]
gh::gh("POST /repos/hughjonesd/huxtable/releases",
name = v,
tag_name = tag,
body = sprintf("Version %s on CRAN", v))

0 comments on commit cc21f86

Please sign in to comment.