Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions .github/workflows/hook-dependencies-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: install runtime dependencies
run: Rscript -e "install.packages(c('renv', 'jsonlite'))"
- name: update PPM URL
run: Rscript inst/update-ppm-url.R
- name: update dependency graph among packages
run: Rscript inst/update-existing-hook-dependencies.R
- name: update existing packages
run: Rscript inst/update-dependency-graph-existing-packages.R
# - name: install runtime dependencies
# run: Rscript -e "install.packages(c('renv', 'jsonlite'))"
# - name: update PPM URL
# run: Rscript inst/update-ppm-url.R
# - name: update dependency graph among packages
# run: Rscript inst/update-existing-hook-dependencies.R
# - name: update existing packages
# run: Rscript inst/update-dependency-graph-existing-packages.R
- name: install pre-commit
run: pip3 install pre-commit
- name: auto-release
run: Rscript -e 'source("renv/activate.R"); renv::restore(); renv::install("."); precommit:::auto_release()'
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
Expand All @@ -40,4 +43,8 @@ jobs:

[1]: https://github.com/peter-evans/create-pull-request


- name: Push latest tag
run: >
TAG="v$(Rscript -e 'cat(as.character(desc::desc_get_version()))')"
git tag $TAG
git push origin $TAG
12 changes: 12 additions & 0 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ release_gh <- function(bump = "dev", is_cran = bump != "dev") {
}
}

auto_release <- function() {
desc_new <- desc::desc_bump_version("dev")
path_template_config <- c(
"inst/pre-commit-config-pkg.yaml",
"inst/pre-commit-config-proj.yaml"
)

purrr::walk(path_template_config, update_rev_in_config,
new_version = as.character(desc_new$get_version())
)
}

git_tag_release <- function(last_release, new_version) {
sys_call("git", glue::glue('tag -a {new_version} -m "{release_msg(last_release, new_version)}"'))
sys_call("git", glue::glue("push origin {new_version}"))
Expand Down
Loading