diff --git a/.gitignore b/.gitignore index dd23b584a..0be4dea5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,12 @@ pep-0000.txt pep-0000.rst pep-????.html +peps.rss __pycache__ *.pyc *.pyo *~ *env .vscode +*.swp +/build diff --git a/.travis.yml b/.travis.yml index b19f1f700..d98622dc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,7 @@ before_install: - pip install docutils script: - make -j + +after_success: + - test $TRAVIS_BRANCH = "master" && + make upload diff --git a/Makefile b/Makefile index 30d7da0ed..377cf7f7c 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ clean: -rm pep-0000.rst -rm pep-0000.txt -rm *.html + -rm -rf build update: git pull https://github.com/python/peps.git @@ -41,3 +42,15 @@ update: venv: $(PYTHON) -m venv venv ./venv/bin/python -m pip install -U docutils + +package: all rss + mkdir -p build/peps + cp *.html build/peps/ + cp *.png build/peps/ + cp *.rss build/peps/ + tar -C build -czf build/peps.tar.gz peps + +upload: venv package + ./venv/bin/python -m pip install awscli + ./venv/bin/aws s3 cp --acl public-read build/peps.tar.gz s3://pythondotorg-assets-staging/peps.tar.gz + ./venv/bin/aws s3 cp --acl public-read build/peps.tar.gz s3://pythondotorg-assets/peps.tar.gz