File tree Expand file tree Collapse file tree 2 files changed +61
-1
lines changed
Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ on: [push]
44
55jobs :
66 build :
7-
87 runs-on : ubuntu-latest
98 strategy :
109 matrix :
1817 with :
1918 python-version : ${{ matrix.python-version }}
2019
20+ - name : Cache pip
21+ uses : actions/cache@v2
22+ with :
23+ # This path is specific to Ubuntu
24+ path : ~/.cache/pip
25+ # Look to see if there is a cache hit for the corresponding requirements file
26+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
27+ restore-keys : |
28+ ${{ runner.os }}-pip-
29+ ${{ runner.os }}-
30+
2131 - name : Install dependencies
2232 run : |
2333 python -m pip install --upgrade pip
Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ tags :
4+
5+ jobs :
6+ publish :
7+ name : Build and publish python packages
8+ runs-on : ubuntu-18.04
9+ steps :
10+ - uses : actions/checkout@v2
11+
12+ - name : Set up Python 3.7
13+ uses : actions/setup-python@v2
14+ with :
15+ python-version : 3.7
16+
17+ - name : Install dependencies
18+ run : python -m pip install --upgrade pip setuptools wheel
19+
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install -r requirements.txt
24+
25+ - name : Cache pip
26+ uses : actions/cache@v2
27+ with :
28+ # This path is specific to Ubuntu
29+ path : ~/.cache/pip
30+ # Look to see if there is a cache hit for the corresponding requirements file
31+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
32+ restore-keys : |
33+ ${{ runner.os }}-pip-
34+ ${{ runner.os }}-
35+
36+ - name : Build dist file
37+ run : |
38+ python setup.py sdist bdist_wheel
39+
40+ - name : Publish distribution to Test PyPI
41+ uses : pypa/gh-action-pypi-publish@master
42+ with :
43+ password : ${{ secrets.test_pypi_password }}
44+ repository_url : https://test.pypi.org/legacy/
45+
46+ - name : Publish distribution to PyPI
47+ if : startsWith(github.ref, 'refs/tags')
48+ uses : pypa/gh-action-pypi-publish@master
49+ with :
50+ password : ${{ secrets.pypi_password }}
You can’t perform that action at this time.
0 commit comments