-
Notifications
You must be signed in to change notification settings - Fork 16
46 lines (44 loc) · 1.51 KB
/
publish-to-test-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
name: Publish Python distributions to PyPI
on:
push:
branches: ["main", "canary", "refresh"]
tags:
- v*
- RC*
pull_request:
branches: ["main", "canary", "refresh"]
jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: tkml
python-version: ${{ matrix.python-version }}
- name: Install pypa/build
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Test wheel
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
pip install dist/*.whl
models=$(turnkey models-location --quiet)
turnkey -i $models/selftest/linear.py discover export-pytorch
- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish distribution package to Test PyPI
if: startsWith(github.ref, 'refs/tags/RC')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/