Skip to content

Commit 496b183

Browse files
try automate push release
1 parent 7364abe commit 496b183

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/hook-dependencies-update.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
run: Rscript inst/update-existing-hook-dependencies.R
2727
- name: update existing packages
2828
run: Rscript inst/update-dependency-graph-existing-packages.R
29+
- name: auto-release
30+
run: Rscript -e 'renv::restore(); precommit:::auto_release()'
2931
- name: Create Pull Request
3032
uses: peter-evans/[email protected]
3133
with:
@@ -40,4 +42,8 @@ jobs:
4042
4143
[1]: https://github.com/peter-evans/create-pull-request
4244
43-
45+
- name: Push latest tag
46+
run: >
47+
TAG="v$(Rscript -e 'cat(as.character(desc::desc_get_version()))')"
48+
git tag $TAG
49+
git push origin $TAG

R/release.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ release_gh <- function(bump = "dev", is_cran = bump != "dev") {
7373
}
7474
}
7575

76+
auto_release <- function() {
77+
autoupdate()
78+
desc_new <- desc::desc_bump_version("dev")
79+
path_template_config <- c(
80+
"inst/pre-commit-config-pkg.yaml",
81+
"inst/pre-commit-config-proj.yaml"
82+
)
83+
84+
purrr::walk(path_template_config, update_rev_in_config,
85+
new_version = as.character(desc_new$get_version())
86+
)
87+
}
88+
7689
git_tag_release <- function(last_release, new_version) {
7790
sys_call("git", glue::glue('tag -a {new_version} -m "{release_msg(last_release, new_version)}"'))
7891
sys_call("git", glue::glue("push origin {new_version}"))

0 commit comments

Comments
 (0)