wp-content

wordpress/hph
Log | Files | Refs | README | LICENSE

commit 64539d51e49820f602c7d5ff539535cfc197d6f0
parent 1aa6d717ed08e5a7f23bc4f68fb499755e0c04db
Author: Sean Enck <sean@ttypty.com>
Date:   Sun,  2 Nov 2025 12:38:12 -0500

build process

Diffstat:
A.github/workflows/build.yml | 32++++++++++++++++++++++++++++++++
Aplugins/hphp/Makefile | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: "build" + +on: + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master + +jobs: + builds: + - name: ubuntu-latest + image: alpine:latest + display: alpine + deps: apk add make tar + - name: macos-latest + image: null + display: macos + deps: "echo no deps" + runs-on: ubuntu-latest + name: alpine-build + container: + image: alpine:latest + steps: + - uses: actions/checkout@v5 + - name: "deps" + run: apk add make minify + - name: "build" + run: cd plugins/hphp && make diff --git a/plugins/hphp/Makefile b/plugins/hphp/Makefile @@ -0,0 +1,54 @@ +PLUGIN_VERSION := 1.8.5 +PLUGIN_JS_VERSION := 1.8.2 +PLUGIN_CSS_VERSION := 1.0.0 +PLUGIN_JS_HASH := 91459f3 +PLUGIN_CSS_HASH := d7a8720 +PLUGIN_HASH := 9215be9 +NEED_FILES := +HAVE_HASH := +NEED_HASH := +HASH_NAME := +ifneq ($(NEED_FILES),) + NEED_HASH := $(shell sha256sum *.$(NEED_FILES) | sort | sha256sum | cut -c 1-7) +endif + +NAME := hphp +TARGET := target/ +ZIP := $(NAME)-$(PLUGIN_VERSION).zip +ARTIFACT := $(TARGET)$(ZIP) +WORKDIR := $(TARGET)$(NAME) + +all: setup check $(ARTIFACT) + +setup: + @mkdir -p $(WORKDIR) + +clean: + @rm -rf $(TARGET) + +$(ARTIFACT): *.* + @minify -q -o $(WORKDIR)/plugin.js plugin.js + @cp *.css $(WORKDIR)/ + @sed "s/{VERSION}/$(PLUGIN_VERSION)/g" hphp.php | \ + sed "s/{CSS_VERSION}/$(PLUGIN_CSS_VERSION)/g" | \ + sed "s/{JS_VERSION}/$(PLUGIN_JS_VERSION)/g" > $(WORKDIR)/hphp.php + @cd $(TARGET) && zip $(ZIP) hphp/* + +check: + @make --no-print-directory _check_hash HAVE_HASH="$(PLUGIN_HASH)" NEED_FILES="*" HASH_NAME=plugin + @make --no-print-directory _check_hash HAVE_HASH="$(PLUGIN_CSS_HASH)" NEED_FILES="css" HASH_NAME=css + @make --no-print-directory _check_hash HAVE_HASH="$(PLUGIN_JS_HASH)" NEED_FILES="js" HASH_NAME=js + + +_check_hash: +ifeq ($(NEED_HASH),) + $(error no hash generated to check) +endif +ifneq ($(NEED_HASH),$(HAVE_HASH)) + $(warning ) + $(warning ===============) + $(warning WARN: found hash $(NEED_HASH) for $(HASH_NAME), version update required) + $(warning ===============) + $(warning ) +endif + @exit 0