-
Notifications
You must be signed in to change notification settings - Fork 11
47 lines (38 loc) · 1.26 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Publish to PyPI
on:
release:
types: [created]
jobs:
publish:
name: "publish"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt \
-r requirements/requirements-test.txt \
-r requirements/requirements-examples.txt
- name: Run pytype
run: |
pytype rax/ examples/flax_integration/ examples/approx_metrics/
- name: Run tests
run: |
python -m unittest discover -v -s ./rax -p "*_test.py"
python -m unittest discover -v -s ./examples/flax_integration -p "*_test.py"
python -m unittest discover -v -s ./examples/approx_metrics -p "*_test.py"
- name: Create package
run: |
pip install --upgrade setuptools build twine virtualenv
python -m build
- name: Upload package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*