-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
152 lines (129 loc) · 3.56 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
app_name=Backup
build_dir=$(CURDIR)/build/artifacts
appstore_dir=$(build_dir)/appstore
source_dir=$(build_dir)/source
sign_dir=$(build_dir)/sign
package_name=$(shell echo $(app_name) | tr '[:upper:]' '[:lower:]')
cert_dir=$(HOME)/.nextcloud/certificates
github_account=nextcloud
release_account=nextcloud-releases
branch=master
version=1.1.0
since_tag=
all: appstore
release: appstore github-release github-upload
github-release:
if [ -z "$(release_account)" ]; then \
release_account=$(github_account); \
release_branch=$(branch); \
else \
release_account=$(release_account); \
release_branch=master; \
fi; \
if [ -z "$(since_tag)" ]; then \
latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1`); \
else \
latest_tag=$(since_tag); \
fi; \
comparison="$$latest_tag..HEAD"; \
if [ -z "$$latest_tag" ]; then comparison=""; fi; \
changelog=$$(git log $$comparison --oneline --no-merges | sed -e 's/^/$(github_account)\/$(package_name)@/'); \
github-release release \
--user $$release_account \
--repo $(package_name) \
--target $$release_branch \
--tag $(version) \
--description "**Changelog**<br/>$$changelog" \
--name "$(app_name) v$(version)"; \
if [ $(github_account) != $$release_account ]; then \
link="https://github.com/$$release_account/$(package_name)/releases/download/$(version)/$(package_name)-$(version).tar.gz";\
github-release release \
--user $(github_account) \
--repo $(package_name) \
--target $(branch) \
--tag $(version) \
--description "**Download**<br />$$link<br /><br />**Changelog**<br/>$$changelog<br />" \
--name "$(app_name) v$(version)"; \
fi; \
github-upload:
if [ -z "$(release_account)" ]; then \
release_account=$(github_account); \
else \
release_account=$(release_account); \
fi; \
github-release upload \
--user $$release_account \
--repo $(package_name) \
--tag $(version) \
--name "$(package_name)-$(version).tar.gz" \
--file $(build_dir)/$(package_name).tar.gz
cs-check: composer-dev
composer cs:check
cs-fix: composer-dev
composer cs:fix
clean:
rm -rf $(build_dir)
rm -rf node_modules
# composer packages
composer:
composer install --prefer-dist --no-dev
composer upgrade --prefer-dist --no-dev
composer-dev:
composer install --prefer-dist --dev
composer upgrade --prefer-dist --dev
appstore: clean composer js
mkdir -p $(sign_dir)
rsync -a \
--exclude=/build \
--exclude=/docs \
--exclude=/translationfiles \
--exclude=/.tx \
--exclude=/tests \
--exclude=.git \
--exclude=/.github \
--exclude=/l10n/l10n.pl \
--exclude=/CONTRIBUTING.md \
--exclude=/issue_template.md \
--exclude=/README.md \
--exclude=/screenshots \
--exclude=/composer.json \
--exclude=/node_modules/ \
--exclude=/src/ \
--exclude=/testConfiguration.json \
--exclude=/composer.lock \
--exclude=/.gitattributes \
--exclude=/.gitignore \
--exclude=/.scrutinizer.yml \
--exclude=/.travis.yml \
--exclude=/Makefile \
./ $(sign_dir)/$(package_name)
tar -czf $(build_dir)/$(package_name).tar.gz \
-C $(sign_dir) $(package_name)
@if [ -f $(cert_dir)/$(package_name).key ]; then \
echo "Signing package…"; \
openssl dgst -sha512 -sign $(cert_dir)/$(package_name).key $(build_dir)/$(package_name).tar.gz | openssl base64; \
fi
js: npm-init npm-update build-js-production
npm-init:
npm ci
npm-update:
npm update
# Building
build-js:
npm run dev
build-js-production:
npm run build
watch-js:
npm run watch
serve-js:
npm run serve
# Linting
lint:
npm run lint
lint-fix:
npm run lint:fix
# Style linting
stylelint:
npm run stylelint
stylelint-fix:
npm run stylelint:fix