ci: improve release process, clean up and re-org repo, add automated minification (#143)

* ci: update scripts

* release 2.7.1

* remove tracked stylesheets

* docs: revert stable tag to 2.7.0

* chore: move Plugin source into own dir

* docs: delete info texts

These can now be found in the [project wiki][wiki].

[wiki]: https://github.com/markcheret/footnotes/wiki

* docs: tweak contributing guide

* ci: reflect new directory structure

* chore: update gitignore

* chore: reflect new dir structure

* docs: update documentation

* build(linting): add Husky hooks, Markdown linting, lint all MD files

* fix pre-push command

* fix pre-push command

* build: add stylesheet, JS minification

* ci: add linting steps

* ci: comment out CSS linting step (that's going to be a whole *thing*)

* ci: minify all JS files

* ci: call correct JS file

* chore: lint

* ci: fix PHP linting commands

* chore: increment version constant string

* ci: concat AMP stylesheets

* ci: improve build scripts

* chore: add assets dir
This commit is contained in:
Ben Goldsworthy 2021-04-25 09:28:02 +01:00 committed by GitHub
parent e780d817c1
commit 6a1117be15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 9761 additions and 2941 deletions

View file

@ -4,17 +4,17 @@ echo "Building Plugin..."
# Moves everything including the style sheets over to `dist/`
echo "Copying directories..."
rm -r dist/
rm -rf dist/
mkdir dist
cp -r -t dist class/ css/ js/ languages/ templates/
cp -r -t dist src/{class,languages,templates}/
# Among the images, only 2 out of 3 are distributed.
echo "Copying the needed images..."
mkdir -p dist/img
cp -t dist/img img/fn-wysiwyg.png
cp -t dist/img src/img/fn-wysiwyg.png
echo "Copying files..."
cp -t dist license.txt readme.txt includes.php wpml-config.xml SECURITY.md
cp -t dist ./{SECURITY.md,CHANGELOG.md,wpml-config.xml} src/{license.txt,readme.txt,includes.php}
echo "Setting production flag..."
sed "s/'PRODUCTION_ENV', false/'PRODUCTION_ENV', true/g" footnotes.php > dist/footnotes.php
sed "s/'PRODUCTION_ENV', false/'PRODUCTION_ENV', true/g" src/footnotes.php > dist/footnotes.php
echo "Production flag set."
# TODO: once automatic minification is implemented, this should handle that.
@ -23,13 +23,13 @@ echo "Production flag set."
echo "Building stylesheets..."
./_tools/build-stylesheets.sh -c
if [ $? != 0 ]; then echo "Concatenation failed!"; exit 1; fi
if [[ $1 != "-y" ]]; then
./_tools/build-stylesheets.sh -m
if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi
fi
./_tools/build-stylesheets.sh -d
if [ $? != 0 ]; then echo "Deployment failed!"; exit 1; fi
echo "Stylesheet build complete."
echo "Minifying CSS and JS..."
mkdir -p dist/{css,js}
npm run minify
if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi
echo "Minification complete."
echo "Build complete."
exit 0