55#
66# This step requires `cargo-edit` installed.
77#
8+ # If bumping the cpp-linter-js package, yarn must be installed to
9+ # update the version in the bindings/node/package.json manifest also.
10+ #
811# 2. Updates the appropriate CHANGELOG.md
912#
1013# Requires `git-cliff` (see https://git-cliff.org) to be installed
@@ -85,6 +88,7 @@ const PkgPaths = {
8588 path : ' bindings/node'
8689 }
8790}
91+
8892export def get-changed-pkgs [] {
8993 let changed_files = (
9094 git ' diff' ' --name-only' ' HEAD~1' ' HEAD'
@@ -99,17 +103,15 @@ export def get-changed-pkgs [] {
99103 let pkg = $row.column0
100104 let paths = $row.column1
101105 print $" Checking changes for ($pkg )..."
102- let has_changed = if ($paths.include | is-empty ) {
103- true
104- } else {
105- $changed_files | any {|file | $paths.include | each {|p | glob $p | any {|g | $g == $file }}}
106+ let has_changed = if ($paths.include | is-empty ) { true } else {
107+ $changed_files | any {|file | $paths.include | any {|p | ($file | path expand ) in (glob $p )}}
106108 }
107109 print $" Has changes: ($has_changed )"
108110 let has_excluded_change = if ($paths.exclude | is-empty ) { false } else {
109- $changed_files | any {|file | $paths.exclude | each {|p | glob $p | any {| g | $g == $file } }}
111+ $changed_files | any {|file | $paths.exclude | any {|p | ( $file | path expand ) in ( glob $p ) }}
110112 }
111113 print $" Has excluded changes: ($has_excluded_change )"
112- if $has_changed and not $has_excluded_change {
114+ if $has_changed {
113115 print $" Package ($pkg ) has relevant changes"
114116 $pkgs = $pkgs | append $pkg
115117 }
@@ -186,8 +188,6 @@ export def gen-changes [
186188 mut args = [
187189 ' --config' $" ($config_path | path join ' cliff.toml' )"
188190 ' --tag-pattern' $" ($pkg )/*"
189- ' --workdir' $path
190- ' --repository' (pwd )
191191 ]
192192 if (($tag | str length ) > 0 ) {
193193 $args = $args | append [' --tag' , $tag ]
@@ -255,13 +255,13 @@ def main [
255255 }
256256 if (is-in-ci ) and $is_main {
257257 print ' Pushing metadata changes'
258- run-cmd ' git' ' config' ' --global' ' user.name' $" ($env .GITHUB_ACTOR )"
259- run-cmd ' git' ' config' ' --global' ' user.email' $" ($env .GITHUB_ACTOR_ID )+($env .GITHUB_ACTOR )@users.noreply.github.com"
260- run-cmd ' git' ' add' ' --all'
261- run-cmd ' git' ' commit' ' -m ' $" build: bump version to ($tag )"
262- run-cmd ' git' ' push'
258+ run-cmd git config -- global user.name $" ($env .GITHUB_ACTOR )"
259+ run-cmd git config -- global user.email $" ($env .GITHUB_ACTOR_ID )+($env .GITHUB_ACTOR )@users.noreply.github.com"
260+ run-cmd git add -- all
261+ run-cmd git commit - m $" build: bump version to ($tag )"
262+ run-cmd git push
263263 print $" Deploying ($tag )"
264- run-cmd ' gh ' ' release' ' create' $tag ' --notes-file' ' .config/ReleaseNotes.md' ' --title' $" ($pkg ) v($ver )"
264+ run-cmd gh release create $tag -- notes-file .config/ReleaseNotes.md -- title $" ($pkg ) v($ver )"
265265 } else if $is_main {
266266 print $" (ansi yellow )Not deploying from local clone.(ansi reset )"
267267 }
0 commit comments