Skip to content

Commit

Permalink
build: Fix build script to commit all files post version bump (#363)
Browse files Browse the repository at this point in the history
- package.json files weren't being included in the commit, just commit
everything
- We can assume we're already at a clean slate in the post_package_bump
- Move other JS plugins to use `npm` for the bump
  • Loading branch information
mofojed authored Mar 19, 2024
1 parent c733932 commit e064712
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ post_package_bump_hooks = [
"../../tools/extract_changelog.sh CHANGELOG.md > ../../releases/GITHUB_CHANGELOG-{{package}}.md",
# update the version number to have a `dev0` suffix
"../../tools/update_version.sh {{package}} {{version}} --dev",
"git commit -m 'chore(version): update {{package}} version to {{version}}'",
"git commit --all --message 'chore(version): update {{package}} version to {{version}}'",
# push the tag and the commits to main
"git push origin {{package}}-v{{version}}",
"git push origin main",
Expand Down
23 changes: 12 additions & 11 deletions tools/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,12 @@ function update_file() {
else
sed -e "s/${prefix}.*/${expected}/g" -i "$ROOT_DIR/plugins/$file"
fi
git add "$ROOT_DIR/plugins/$file"
fi
}

extra=
[ "$dev" = true ] && extra=".dev0"
case "$package" in
auth-keycloak)
update_file auth-keycloak/src/js/package.json '"version": "' '",'
;;
dashboard-object-viewer)
update_file dashboard-object-viewer/src/js/package.json '"version": "' '",'
;;
json)
update_file json/src/deephaven/plugin/json/__init__.py '__version__ = "' '"' "$extra"
;;
Expand All @@ -132,9 +125,6 @@ case "$package" in
plotly-express)
update_file plotly-express/setup.cfg 'version = ' '' "$extra"
;;
table-example)
update_file table-example/src/js/package.json '"version": "' '",'
;;
ui)
update_file ui/setup.cfg 'version = ' '' "$extra"
;;
Expand All @@ -144,6 +134,9 @@ case "$package" in
packaging)
update_file packaging/setup.cfg 'version = ' '' "$extra"
;;
auth-keycloak | dashboard-object-viewer | table-example)
# Packages that don't have any Python to publish, just ignore
;;
*)
{
log_error "Unhandled plugin $package. You will need to add wiring in $SCRIPT_NAME"
Expand All @@ -155,10 +148,18 @@ esac
npm_version="${version}"
[ "$dev" = true ] && npm_version="${version}-dev0"
case "$package" in
matplotlib | plotly | plotly-express | ui)
auth-keycloak | dashboard-object-viewer | matplotlib | plotly | plotly-express | table-example | ui)
# The working directory is already `plugins/<package-name>`, so we just specify workspace as `src/js` and it does the right thing
npm version "$npm_version" --workspace=src/js
;;
json | packaging | utilities)
# Packages that don't have any JS to publish, just ignore
;;
*)
{
log_error "Unhandled JS plugin $package. You will need to add JS wiring in $SCRIPT_NAME"
exit 90
}
esac

log_info "Done updating $package version to $version${extra}"

0 comments on commit e064712

Please sign in to comment.