Skip to content

Commit efac086

Browse files
Add new github action: publish on Pypi
1 parent e23ef42 commit efac086

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish on PyPi Workflow
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
python-version: ['3.11']
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python ${{ matrix.python-version }}
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: ${{ matrix.python-version }}
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install flake8 coverage
20+
pip install -r requirements.txt
21+
- name: Lint with flake8
22+
run: |
23+
pip install -e .
24+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
25+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
26+
- name: Test with unittest
27+
run: |
28+
python -m unittest discover -s ./async_include/tests
29+
- name: Generate the coverage report
30+
run: |
31+
coverage run --source=async_include/tests -m unittest
32+
coverage xml -o coverage.xml
33+
- name: Publish code coverage to code climate
34+
uses: paambaati/[email protected]
35+
env:
36+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
37+
with:
38+
coverageCommand: coverage report
39+
- name: Create distribution package to PyPI
40+
run: |
41+
pip install pypandoc
42+
python setup.py sdist
43+
- name: Publish a Python distribution to PyPI
44+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
user: __token__
48+
password: ${{ secrets.DJANGO_ASYNC_INCLUDE_PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)