-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (40 loc) · 1.05 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
47
48
49
50
51
# .github/workflows/publish.yml
name: Publish Package
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11' # Specify your Python version here
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest tests/
publish:
runs-on: ubuntu-latest
needs: test
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build package
run: |
python setup.py sdist
python setup.py bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.7.1
with:
password: ${{ secrets.PYPI_API_TOKEN }}