chore: don't include dist in the release commit (#2385)

This commit is contained in:
ylemkimon
2020-08-10 08:52:34 +09:00
committed by GitHub
parent dcd97aa0c2
commit 057b02feac
3 changed files with 5 additions and 18 deletions

View File

@@ -5,7 +5,7 @@
[![Join the chat at https://gitter.im/KaTeX/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=KaTeX/KaTeX)](https://dependabot.com)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
![](https://img.badgesize.io/KaTeX/KaTeX/v0.12.0/dist/katex.min.js?compression=gzip)
![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX)
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

View File

@@ -181,27 +181,20 @@ if [[ ! $PUBLISH ]]; then
echo "After it gets merged, run './release.sh -p $VERSION'!"
echo "Note that if KaTeX source code is changed after running this script,"
echo "you have to run the release script again."
else
# Make a new detached HEAD
git checkout --detach
git diff --stat --exit-code # check for uncommitted changes
else
# Edit package.json to the right version
sed -i.bak -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json
rm -f package.json.bak
# Build generated files and add them to the repository
git clean -fdx dist
# Build generated files
yarn dist
sed -i.bak -E '/^\/dist\/$/d' .gitignore
rm -f .gitignore.bak
# Check Subresource Integrity hashes
yarn node update-sri.js check README.md contrib/*/README.md
# Make the commit and tag, and push them.
git add package.json .gitignore dist/
git commit -n -m "v$VERSION"
git diff --stat --exit-code # check for uncommitted changes
# Make the tag and push
git tag -a "v$VERSION" -m "v$VERSION"
git push "$ORIGIN" "v$VERSION"
@@ -216,8 +209,6 @@ else
echo "Don't forget to upload katex.tar.gz and katex.zip to the release!"
fi
git diff --stat --exit-code # check for uncommitted changes
if [[ $DRY_RUN ]]; then
echo ""
echo "This was a dry run."

View File

@@ -9,10 +9,6 @@ const version = process.argv[2];
Promise.all(process.argv.slice(3).map(file =>
fs.readFile(file, "utf8")
.then(body => {
// Replace size badge url
// eslint-disable-next-line max-len
body = body.replace(/(https:\/\/img\.badgesize\.io\/KaTeX\/KaTeX\/v)(?:.+)(\/dist\/katex\.min\.js\?compression=gzip)/g, `$1${version}$2`);
// Replace CDN urls
// 1 - url prefix: "http…/KaTeX/
// 2 - opening quote: "