Эх сурвалжийг харах

update deployment and make targets

Dimitri Korsch 5 жил өмнө
parent
commit
0e670e6f47
2 өөрчлөгдсөн 24 нэмэгдсэн , 7 устгасан
  1. 8 7
      Makefile
  2. 16 0
      deploy_latest.sh

+ 8 - 7
Makefile

@@ -1,14 +1,15 @@
 install:
 	pip install . --no-deps --upgrade
 
-build:
-	python setup.py build
+build_sdist:
+	@python setup.py build sdist
 
-deploy:
-	python setup.py sdist upload -r pypi
+deploy: build_sdist
+	./deploy_latest.sh
 
-test_deploy:
-	python setup.py sdist upload -r pypitest
+test_deploy: build_sdist
+	REPO=pypitest ./deploy_latest.sh
 
 get_version:
-	@python -c "import cvargparse; print('v{}'.format(cvargparse.__version__))"
+	@printf "v"
+	@python setup.py --version

+ 16 - 0
deploy_latest.sh

@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+current_version=$(python setup.py --version)
+
+REPO=${REPO:-pypi}
+
+echo "Uploading to ${REPO} ..."
+
+twine upload \
+	--repository ${REPO} \
+	dist/*${current_version}.tar.gz \
+
+ret_code=$?
+if [[ $ret_code == 0 ]]; then
+	echo "OK"
+fi