mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
[build] Refactor Makefile
This commit is contained in:
47
Makefile
47
Makefile
@@ -1,31 +1,48 @@
|
||||
NAME=asciinema
|
||||
VERSION=`python3 -c "import asciinema; print(asciinema.__version__)"`
|
||||
NAME := asciinema
|
||||
VERSION := $(shell python3 -c "import asciinema; print(asciinema.__version__)")
|
||||
|
||||
test: test-unit test-integration
|
||||
.PHONY: test
|
||||
test: test.unit test.integration
|
||||
|
||||
test-unit:
|
||||
.PHONY: test.unit
|
||||
test.unit:
|
||||
nosetests
|
||||
|
||||
test-integration:
|
||||
.PHONY: test.integration
|
||||
test.integration:
|
||||
tests/integration.sh
|
||||
|
||||
.PHONY: release
|
||||
release: test tag push
|
||||
|
||||
release-test: test push-test
|
||||
.PHONY: release.test
|
||||
release.test: test push.test
|
||||
|
||||
tag:
|
||||
git tag | grep "v$(VERSION)" && echo "Tag v$(VERSION) exists" && exit 1 || true
|
||||
.PHONY: .tag.exists
|
||||
.tag.exists:
|
||||
@git tag \
|
||||
| grep -q "v$(VERSION)" \
|
||||
&& echo "Tag v$(VERSION) exists" \
|
||||
&& exit 1
|
||||
|
||||
.PHONY: tag
|
||||
tag: .tag.exists
|
||||
git tag -s -m "Releasing $(VERSION)" v$(VERSION)
|
||||
git push origin v$(VERSION)
|
||||
|
||||
push:
|
||||
python3 -m pip install --user --upgrade --quiet twine
|
||||
python3 setup.py sdist bdist_wheel
|
||||
|
||||
.PHONY: .pip
|
||||
.pip:
|
||||
python3 -m pip install --user --upgrade --quiet build twine
|
||||
|
||||
build:
|
||||
python3 -m build .
|
||||
|
||||
.PHONY: push
|
||||
push: .pip build
|
||||
python3 -m twine upload dist/*
|
||||
|
||||
push-test:
|
||||
python3 -m pip install --user --upgrade --quiet twine
|
||||
python3 setup.py sdist bdist_wheel
|
||||
.PHONY: push.test
|
||||
push.test: .pip build
|
||||
python3 -m twine upload --repository testpypi dist/*
|
||||
|
||||
.PHONY: test test-unit test-integration release release-test tag push push-test
|
||||
|
||||
Reference in New Issue
Block a user