diff --git a/.github/workflows/hook-dependencies-update.yml b/.github/workflows/hook-dependencies-update.yml index 7d99b7d51..404e472a4 100644 --- a/.github/workflows/hook-dependencies-update.yml +++ b/.github/workflows/hook-dependencies-update.yml @@ -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/create-pull-request@v6.1.0 with: @@ -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 diff --git a/R/release.R b/R/release.R index 7f944113d..0af677a61 100644 --- a/R/release.R +++ b/R/release.R @@ -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}"))