forked from avocado-framework/avocado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.gh
100 lines (85 loc) · 2.81 KB
/
Makefile.gh
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
# This Makefile contains targets used by GitHub Actions
include Makefile.include
ifndef AVOCADO_OPTIONAL_PLUGINS
AVOCADO_OPTIONAL_PLUGINS=$(shell find ./optional_plugins -maxdepth 1 -mindepth 1 -type d)
endif
ifndef DEVEL_NAME
DEVEL_NAME=$(shell git config --get user.name)
endif
ifndef DEVEL_MAIL
DEVEL_NAME=$(shell git config --get user.email)
endif
all:
@echo
@echo "This file contains targets used by GitHub Actions."
@echo
codespell:
pip install codespell==2.2.4
codespell --check-filenames --check-hidden --skip ".git,*.js,./selftests/unit/utils/cpu.py.data/*,./avocado/utils/pmem.py,./avocado/utils/cpu.py,./avocado/utils/linux_modules.py,./selftests/functional/output.py,./selftests/unit/utils/vmimage.py"
bandit:
pip install bandit
bandit -o bandit-output.txt -r --skip B101,B105,B311,B404,B603 .
propagate-version:
echo "$(VERSION)" > VERSION
for DIR in $(AVOCADO_OPTIONAL_PLUGINS); do\
if test -f "$$DIR/VERSION"; then\
echo ">> Updating $$DIR"; echo "$(VERSION)" > "$$DIR/VERSION";\
else echo ">> Skipping $$DIR"; fi;\
done
release-update-spec:
rpmdev-bumpspec -n "$(VERSION)" -u "$(DEVEL_NAME) <$(DEVEL_MAIL)>" -c "New release" python-avocado.spec
sed -i 's/^Release:.*/Release: 1%{?gitrel}%{?dist}/' python-avocado.spec
release-commit-tag:
git commit -m "Changes for release $(VERSION)" -a
git tag "$(VERSION)" -m "Release $(VERSION)"
build-update-readthedocs:
ifndef TOKEN_RTD
$(error TOKEN_RTD is undefined)
endif
ifndef URL
$(error URL is undefined)
endif
# Activate version
curl -X PATCH \
-H "Authorization: Token $(TOKEN_RTD)" "$(URL)/versions/$(VERSION)/" \
-H "Content-Type: application/json" -d '{"active": true, "hidden": false }'
# Build new version
curl -X POST \
-H "Authorization: Token $(TOKEN_RTD)" "$(URL)/versions/$(VERSION)/builds/"
build-wheel: pip
$(PYTHON) -m pip install $(PYTHON_DEVELOP_ARGS) build
if test ! -d PYPI_UPLOAD; then mkdir PYPI_UPLOAD; fi
$(PYTHON) -m build -o PYPI_UPLOAD
for PLUGIN in $(AVOCADO_OPTIONAL_PLUGINS); do\
if test -f $$PLUGIN/setup.py; then\
cd $$PLUGIN;\
$(PYTHON) -m build -o ../../PYPI_UPLOAD;\
cd -;\
fi;\
done
build-egg:
if test ! -d EGG_UPLOAD; then mkdir EGG_UPLOAD; fi
$(PYTHON) setup.py bdist_egg -d EGG_UPLOAD
for PLUGIN in $(AVOCADO_OPTIONAL_PLUGINS); do\
if test -f $$PLUGIN/setup.py; then\
cd $$PLUGIN;\
$(PYTHON) setup.py bdist_egg -d ../../EGG_UPLOAD;\
cd -;\
fi;\
done
update-pypi:
ifndef TWINE_USERNAME
$(error TWINE_USERNAME is undefined)
endif
ifndef TWINE_PASSWORD
$(error TWINE_PASSWORD is undefined)
endif
pip install twine
export TWINE_NON_INTERACTIVE=true
twine upload PYPI_UPLOAD/*.{tar.gz,whl}
variables:
@echo "PYTHON: $(PYTHON)"
@echo "VERSION: $(VERSION)"
@echo "AVOCADO_OPTIONAL_PLUGINS: $(AVOCADO_OPTIONAL_PLUGINS)"
@echo "DEVEL_NAME: $(DEVEL_NAME)"
@echo "DEVEL_MAIL: $(DEVEL_MAIL)"