-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (44 loc) · 1.53 KB
/
publish-to-pypi.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
47
48
name: Publish Python distributions to PyPI and TestPyPI
on:
release:
types: [published]
jobs:
build-n-publish:
name: Build and publish Python distributions to TestPyPI and PyPI
runs-on: [self-hosted, Linux, X64, gpu]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install ./[dev]
python3 -m pip install cupy-cuda112
- name: Cache Data
id: cache-data
uses: actions/cache@v2
with:
path: data
key: ${{ runner.os }}-data-v5
- name: Download datasets if not cached
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
./scripts/download-data.sh
- name: Build a binary wheel and a source tarball
run: |
python3 -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Test pypi deployment
run: |
pytest tests/test_gpucsl.py::test_gpucsl_testPyPI --run_testPyPI
- name: Publish distribution to PyPI if commit is tagged
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}