-
Notifications
You must be signed in to change notification settings - Fork 4
32 lines (32 loc) · 968 Bytes
/
main.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
name: Publish to TestPyPI
on:
push:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
pip install -r requirements.txt
pip install pytest
- name: Test with pytest
run: |
pytest tests -v
- name: Build and publish to TestPyPI
run: |
# Install the package from setup.py
python3 setup.py install
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TEST_TOKEN }}