-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.22 KB
/
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
name: Deploy to TestPyPI
on:
workflow_run:
workflows: ["Run linter and tests"]
types:
- completed
jobs:
deploy-to-testpypi:
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'develop' &&
github.event.workflow_run.event == 'pull_request' &&
contains(github.event.workflow_run.pull_requests.*.title, 'deploy to testpypi')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.10.11
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements/dev.txt') }}
- name: Install dependencies
run: |
pip install --upgrade --upgrade-strategy eager -r requirements/dev.txt
- name: Build and publish to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*