-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
55 lines (47 loc) · 2.08 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
GITHUB_REPO := https://github.com/XPRNetwork/xpr-checkout-wp
FILES := README.md info.json xprcheckout.php # List your files here
LATEST_TAG := $(shell git ls-remote --tags $(GITHUB_REPO) | awk -F/ '{print $$NF}' | grep -v '{}' | sort -V | tail -n1)
define MANIFEST_BODY
{
"name" : "XPRCheckout: WooCommerce WebAuth gateway",
"slug" : "xprcheckout_woocommerce_webauth_gateway",
"author" : "<a href='https://rockerone.io'>RockerOne</a>",
"author_profile" : "http://profiles.wordpress.org/rocker0ne",
"version" : "$(LATEST_TAG)",
"download_url" : "https://github.com/XPRNetwork/xpr-checkout-wp/releases/tag/$(VERSION)",
"requires" : "5.0",
"tested" : "5.0",
"requires_php" : "7.0",
"last_updated" : "$(shell date +"%Y-%m-%-d %H:%M:%S")",
"sections" : {
"description" : "A WebAuth wallet enabled Gateway for WooCommerce",
"installation" : "See the github repo home page",
"changelog" : "See commit on main branch"
},
"banners" : {
"low" : "",
"high" : ""
}
}
endef
export MANIFEST_BODY
generate_manifest:
@echo "$$MANIFEST_BODY" > info.json
.PHONY: update_version
update_version:
@if [ -z "$(LATEST_TAG)" ]; then \
echo "No tag found in the repository"; \
exit 1; \
fi
@echo "Replacing ##VERSION_TAG## with the latest tag: $(LATEST_TAG)"
@for file in $(FILES); do \
sed -i '' -e "s/##VERSION_TAG##/$(LATEST_TAG)/g" $$file; \
echo "Updated $$file"; \
done
compile_apps:
rm -rf ./dist
mkdir dist
cd ./applications/apps/block && rm -rf ./build && bun run build && cd ./../../../dist && mkdir block && cd ../ && cp -r ./applications/apps/block/build ./dist/block
cd ./applications/apps/checkout && rm -rf ./build && bun run build && cd ./../../../dist && mkdir checkout && cd ../ && cp -r ./applications/apps/checkout/build ./dist/checkout
cd ./applications/apps/regstore && rm -rf ./build && bun run build && cd ./../../../dist && mkdir regstore && cd ../ && cp -r ./applications/apps/regstore/build ./dist/regstore
cd ./applications/apps/refund && rm -rf ./build && bun run build && cd ./../../../dist && mkdir refund && cd ../ && cp -r ./applications/apps/refund/build ./dist/refund