ci: update build process and linter to reflect new layout

This commit is contained in:
Ben Goldsworthy 2021-04-26 22:57:56 +01:00
parent 67059b45cd
commit 0e5a6830fe
3 changed files with 23 additions and 22 deletions

View file

@ -14,31 +14,32 @@ echo "Running $(dirname "$0")/build-stylesheets.sh"
if [[ $1 == "-c" ]]; then
echo "Concatenating files and placing in \`dist/css/\`..."
echo "Concatenating files and placing in \`dist/{public,admin}/css/\`..."
mkdir -p ./dist/css
cat ./src/css/dev-common.css > ./dist/css/footnotes-nottbrpl0.css
mkdir -p ./dist/{public,admin}/css
cat ./src/css/dev-{common,layout-reference-container}.css > ./dist/css/footnotes-nottbrpl1.css
cat ./src/css/dev-{common,layout-entry-content}.css > ./dist/css/footnotes-nottbrpl2.css
cat ./src/css/dev-{common,layout-main-content}.css > ./dist/css/footnotes-nottbrpl3.css
cat ./src/public/css/dev-common.css > ./dist/public/css/footnotes-nottbrpl0.css
cat ./src/css/dev-{common,tooltips}.css > ./dist/css/footnotes-jqttbrpl0.css
cat ./src/css/dev-{common,tooltips,layout-reference-container}.css > ./dist/css/footnotes-jqttbrpl1.css
cat ./src/css/dev-{common,tooltips,layout-entry-content}.css > ./dist/css/footnotes-jqttbrpl2.css
cat ./src/css/dev-{common,tooltips,layout-main-content}.css > ./dist/css/footnotes-jqttbrpl3.css
cat ./src/public/css/dev-{common,layout-reference-container}.css > ./dist/public/css/footnotes-nottbrpl1.css
cat ./src/public/css/dev-{common,layout-entry-content}.css > ./dist/public/css/footnotes-nottbrpl2.css
cat ./src/public/css/dev-{common,layout-main-content}.css > ./dist/public/css/footnotes-nottbrpl3.css
cat ./src/css/dev-{common,tooltips,tooltips-alternative}.css > ./dist/css/footnotes-alttbrpl0.css
cat ./src/css/dev-{common,tooltips,tooltips-alternative,layout-reference-container}.css > ./dist/css/footnotes-alttbrpl1.css
cat ./src/css/dev-{common,tooltips,tooltips-alternative,layout-entry-content}.css > ./dist/css/footnotes-alttbrpl2.css
cat ./src/css/dev-{common,tooltips,tooltips-alternative,layout-main-content}.css > ./dist/css/footnotes-alttbrpl3.css
cat ./src/public/css/dev-{common,tooltips}.css > ./dist/public/css/footnotes-jqttbrpl0.css
cat ./src/public/css/dev-{common,tooltips,layout-reference-container}.css > ./dist/public/css/footnotes-jqttbrpl1.css
cat ./src/public/css/dev-{common,tooltips,layout-entry-content}.css > ./dist/public/css/footnotes-jqttbrpl2.css
cat ./src/public/css/dev-{common,tooltips,layout-main-content}.css > ./dist/public/css/footnotes-jqttbrpl3.css
cat ./src/css/dev-{common,tooltips,amp-tooltips}.css > ./dist/css/footnotes-amptbrpl0.css
cat ./src/css/dev-{common,tooltips,amp-tooltips,layout-reference-container}.css > ./dist/css/footnotes-amptbrpl1.css
cat ./src/css/dev-{common,tooltips,amp-tooltips,layout-entry-content}.css > ./dist/css/footnotes-amptbrpl2.css
cat ./src/css/dev-{common,tooltips,amp-tooltips,layout-main-content}.css > ./dist/css/footnotes-amptbrpl3.css
cat ./src/public/css/dev-{common,tooltips,tooltips-alternative}.css > ./dist/public/css/footnotes-alttbrpl0.css
cat ./src/public/css/dev-{common,tooltips,tooltips-alternative,layout-reference-container}.css > ./dist/public/css/footnotes-alttbrpl1.css
cat ./src/public/css/dev-{common,tooltips,tooltips-alternative,layout-entry-content}.css > ./dist/public/css/footnotes-alttbrpl2.css
cat ./src/public/css/dev-{common,tooltips,tooltips-alternative,layout-main-content}.css > ./dist/public/css/footnotes-alttbrpl3.css
cat ./src/css/settings.css > ./dist/css/settings.css
cat ./src/public/css/dev-{common,tooltips,amp-tooltips}.css > ./dist/public/css/footnotes-amptbrpl0.css
cat ./src/public/css/dev-{common,tooltips,amp-tooltips,layout-reference-container}.css > ./dist/public/css/footnotes-amptbrpl1.css
cat ./src/public/css/dev-{common,tooltips,amp-tooltips,layout-entry-content}.css > ./dist/public/css/footnotes-amptbrpl2.css
cat ./src/public/css/dev-{common,tooltips,amp-tooltips,layout-main-content}.css > ./dist/public/css/footnotes-amptbrpl3.css
cat ./src/admin/css/settings.css > ./dist/admin/css/settings.css
echo "Stylesheet concatenation complete."
exit 0

View file

@ -8,7 +8,7 @@ rm -rf dist/
mkdir dist
rsync -av --progress --exclude css src/* dist
echo "Setting production flag environment flag..."
sed -i "s/'PRODUCTION_ENV' , false/'PRODUCTION_ENV' , true/g" ./dist/footnotes.php
sed -i -E "s/('PRODUCTION_ENV'[ ]?,[ ]?)false/\1true/g" ./dist/footnotes.php
echo "Production environment flag set."
echo "Setting pre-release version tags..."
@ -29,7 +29,7 @@ echo "Minifying CSS and JS..."
npm run minify
if [ $? != 0 ]; then echo "Minification failed!"; exit 1; fi
echo "Deleting unminified files from `dist/`..."
rm -r dist/**/*[^.min].{js,css}
rm -r dist/*/{js,css}/*[^\.min].{js,css}
echo "Minification complete."
if [[ $1 == "-v" ]]; then

View file

@ -20,7 +20,7 @@
"validate": "npm run validate:json && npm run validate:yaml",
"validate:yaml": "yaml-validator ./.github/workflows/*.yml",
"minify": "npm run minify:css && npm run minify:js",
"minify:css": "for f in ./dist/css/*.css; do echo \"Minifying $f...\"; minify $f > $(dirname $f)/$(basename $f .css).min.css; done",
"minify:css": "for f in ./dist/*/css/*.css; do echo \"Minifying $f...\"; minify $f > $(dirname $f)/$(basename $f .css).min.css; done",
"minify:js": "for f in ./dist/*/js/*.js; do echo \"Minifying $f...\"; minify $f > $(dirname $f)/$(basename $f .js).min.js; done"
},
"husky": {