소스 검색

update deployment and make targets

Dimitri Korsch 5 년 전
부모
커밋
93f015a4d9
2개의 변경된 파일22개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      Makefile
  2. 16 0
      deploy_latest.sh

+ 6 - 6
Makefile

@@ -1,14 +1,14 @@
 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:
 	@printf "v"

+ 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