js-beautify/tools/release-all.sh
github-actions[bot] 1d3d3e65b8
Pulling staging/release into release (#2244)
* Format index.html

* Fix package.json files config

* Ignore Pythong .eggs directory

* update strings for move from beautify-web to beautifier org

* Bump actions/setup-python from 4 to 5

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github/codeql-action from 2 to 3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update codemirror and other web page depenedencies (#2234)

* Fixed #2219 - formatting of new Angular control flow syntax (#2221)

* Fixed #2219 - formatting of new Angular control flow syntax

* Add 'angular' templating option; use it for html beautifier control flow syntax

* Add more precise selection for angular control flow close tag

* Print angular control flow tokens with basic formatting

* Add tests for fixing issue #2219

* Change angular control flow selection to do via pattern

* Fix selecting control flow closing brace if it is not preceded by whitespace

* Fix regex for control flow start pattern; only select control flow open if indent_handlebars is true

* Changing angular at-string detection regex

Limiting this to a smaller set.

---------

Co-authored-by: Liam Newman <bitwiseman@gmail.com>

* Update Changelog

* Bump version numbers for 1.15.0

* Release: 1.15.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Liam Newman <bitwiseman@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gergely-gyorgy-both <84864554+gergely-gyorgy-both@users.noreply.github.com>
Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
2024-02-15 10:58:05 -08:00

155 lines
3.9 KiB
Bash
Executable File

#!/usr/bin/env bash
REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
case "$OSTYPE" in
darwin*) PLATFORM="OSX" ;;
linux*) PLATFORM="LINUX" ;;
bsd*) PLATFORM="BSD" ;;
*) PLATFORM="UNKNOWN" ;;
esac
release_python()
{
cd $SCRIPT_DIR/..
git clean -xfd || exit 1
git fetch --all || exit 1
git checkout -B staging/release origin/staging/release
git clean -xfd || exit 1
cd python
# python setup.py register -r pypi
cp setup-js.py setup.py || exit 1
python setup.py sdist || exit 1
cp setup-css.py setup.py || exit 1
python setup.py sdist || exit 1
rm setup.py || exit 1
python -m twine upload dist/* || exit 1
}
release_node()
{
cd $SCRIPT_DIR/..
git clean -xfd || exit 1
git fetch --all || exit 1
git checkout -B staging/release origin/staging/release
git clean -xfd || exit 1
unset NPM_TAG
if [[ $NEW_VERSION =~ .*(rc|beta).* ]]; then
NPM_TAG='--tag next'
fi
$SCRIPT_DIR/npm publish . $NPM_TAG || exit 1
}
release_web()
{
cd $SCRIPT_DIR/..
git clean -xfd || exit 1
git fetch --all || exit 1
git checkout -B staging/gh-pages site/staging/gh-pages || exit 1
git reset --hard site/gh-pages || exit 1
git merge origin/staging/release --no-edit || exit 1
git push || exit 1
git checkout -B staging/main site/staging/main || exit 1
git reset --hard site/main || exit 1
git merge origin/staging/main --no-edit || exit 1
git push || exit 1
}
sedi() {
if [[ "$PLATFORM" == "OSX" || "$PLATFORM" == "BSD" ]]; then
sed -i "" $@
elif [ "$PLATFORM" == "LINUX" ]; then
sed -i $@
else
exit 1
fi
}
update_versions()
{
cd $SCRIPT_DIR/..
git clean -xfd || exit 1
git fetch --all || exit 1
# trigger remote uses deploy key, push will cause downstream GitHub Actions to fire
git checkout -B staging/main trigger/staging/main || exit 1
git merge origin/main --no-edit || exit 1
git clean -xfd || exit 1
# Disabled due to build break
$SCRIPT_DIR/generate-changelog.sh beautifier/js-beautify $GITHUB_TOKEN || exit 1
$SCRIPT_DIR/npm version --no-git-tag-version $NEW_VERSION || exit 1
sedi -E 's@(cdnjs.cloudflare.+beautify/)[^/]+@\1'$NEW_VERSION'@' README.md
sedi -E 's/\((README\.md:.js-beautify@).+\)/(\1'$NEW_VERSION')/' README.md
echo "__version__ = \"$NEW_VERSION\"" > python/jsbeautifier/__version__.py
echo "__version__ = \"$NEW_VERSION\"" > python/cssbeautifier/__version__.py
git add . || exit 1
git commit -am "Bump version numbers for $NEW_VERSION" || exit 1
git push || exit 1
}
update_release_branch()
{
cd $SCRIPT_DIR/..
git clean -xfd || exit 1
git fetch --all || exit 1
git reset --hard
# trigger remote uses deploy key, push will cause downstream GitHub Actions to fire
git checkout -B staging/release trigger/staging/release || exit 1
git merge origin/release --no-edit || exit 1
git merge origin/staging/main --no-edit || exit 1
make js || exit 1
git add -f js/lib/ || exit 1
git add -f js/test/generated/
git add -f python/jsbeautifier/tests/generated/
git add -f python/cssbeautifier/tests/generated/
git commit -m "Release: $NEW_VERSION"
git tag "v$NEW_VERSION" || exit 1
git push || exit 1
git push --tags
}
main()
{
cd $SCRIPT_DIR/..
local NEW_VERSION=$1
NEW_VERSION=${NEW_VERSION/v/}
if [[ ! $NEW_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9].*$ ]]; then
echo Version number must start with MAJOR.MINOR.INCREMENTAL numbering.
exit 1
fi
npm --version > /dev/null || {
echo ERROR: npm must be installed before attempting release
exit 1
}
twine -h > /dev/null || {
exit 1
}
update_versions
update_release_branch
release_python
release_node
release_web
git checkout main
}
(main $*)