From 0e5a6830fe6bdad6a2a8858a5a038f9760da903e Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 26 Apr 2021 22:57:56 +0100 Subject: [PATCH] ci: update build process and linter to reflect new layout --- _tools/build-stylesheets.sh | 39 +++++++++++++++++++------------------ _tools/build.sh | 4 ++-- package.json | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/_tools/build-stylesheets.sh b/_tools/build-stylesheets.sh index 4eae42e..73650d8 100755 --- a/_tools/build-stylesheets.sh +++ b/_tools/build-stylesheets.sh @@ -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 diff --git a/_tools/build.sh b/_tools/build.sh index c544c5e..09ade5d 100755 --- a/_tools/build.sh +++ b/_tools/build.sh @@ -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 diff --git a/package.json b/package.json index 52c9d07..1497952 100644 --- a/package.json +++ b/package.json @@ -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": {