Skip to content

Commit 9317106

Browse files
committed
build updates
1 parent a220061 commit 9317106

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: [push]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
98
strategy:
109
matrix:
@@ -18,6 +17,17 @@ jobs:
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

.github/workflows/pypi.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 }}

0 commit comments

Comments
 (0)