File tree Expand file tree Collapse file tree 9 files changed +356
-178
lines changed Expand file tree Collapse file tree 9 files changed +356
-178
lines changed Original file line number Diff line number Diff line change 99 strategy :
1010 max-parallel : 4
1111 matrix :
12- python-version : [3.7 ]
12+ python-version : [3.9 ]
1313
1414 steps :
1515 - name : Checkout code
Original file line number Diff line number Diff line change 1+ name : Release library as a PyPI wheel and sdist on GH release creation
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ build-and-publish-to-pypi :
9+ name : Build and publish library to PyPI
10+ runs-on : ubuntu-20.04
11+ steps :
12+ - uses : actions/checkout@master
13+ - name : Set up Python
14+ uses : actions/setup-python@v1
15+ with :
16+ python-version : 3.9
17+ - name : Install pypa/build
18+ run : python -m pip install build --user
19+ - name : Build a binary wheel and a source tarball
20+ run : python -m build --sdist --wheel --outdir dist/
21+ .
22+ - name : Publish distribution to PyPI
23+ if : startsWith(github.ref, 'refs/tags')
24+ uses : pypa/gh-action-pypi-publish@master
25+ with :
26+ password : ${{ secrets.PYPI_API_TOKEN }}
27+
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ CLI_ARGS=$1
3030# Requirement arguments passed to pip and used by default or with --dev.
3131REQUIREMENTS=" --editable . --constraint requirements.txt"
3232DEV_REQUIREMENTS=" --editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
33+ DOCS_REQUIREMENTS=" --editable .[docs] --constraint requirements.txt"
3334
3435# where we create a virtualenv
3536VIRTUALENV_DIR=venv
@@ -54,7 +55,7 @@ CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5455# ###############################
5556# Thirdparty package locations and index handling
5657# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
57- if [ -f " $CFG_ROOT_DIR /thirdparty" ]; then
58+ if [ -d " $CFG_ROOT_DIR /thirdparty" ]; then
5859 PIP_EXTRA_ARGS=" --find-links $CFG_ROOT_DIR /thirdparty"
5960fi
6061PIP_EXTRA_ARGS=" $PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html"
@@ -177,6 +178,7 @@ while getopts :-: optchar; do
177178 help ) cli_help;;
178179 clean ) find_python && clean;;
179180 dev ) CFG_REQUIREMENTS=" $DEV_REQUIREMENTS " ;;
181+ docs ) CFG_REQUIREMENTS=" $DOCS_REQUIREMENTS " ;;
180182 esac ;;
181183 esac
182184done
Original file line number Diff line number Diff line change 2828@ rem # Requirement arguments passed to pip and used by default or with --dev.
2929set " REQUIREMENTS = --editable . --constraint requirements.txt"
3030set " DEV_REQUIREMENTS = --editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
31+ set " DOCS_REQUIREMENTS = --editable .[docs] --constraint requirements.txt"
3132
3233@ rem # where we create a virtualenv
3334set " VIRTUALENV_DIR = venv"
@@ -77,6 +78,9 @@ if not "%1" == "" (
7778 if " %1 " EQU " --dev" (
7879 set " CFG_REQUIREMENTS = %DEV_REQUIREMENTS% "
7980 )
81+ if " %1 " EQU " --docs" (
82+ set " CFG_REQUIREMENTS = %DOCS_REQUIREMENTS% "
83+ )
8084 shift
8185 goto again
8286)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments