Skip to content

Commit 899d018

Browse files
committed
Add publish workflow
1 parent b3c434a commit 899d018

2 files changed

Lines changed: 43 additions & 5 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Django Task API Tests
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [ master ]
99
pull_request:
1010

1111
jobs:
@@ -25,13 +25,19 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Install poetry
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install poetry
32+
poetry env use system
33+
2834
- name: Install celery
2935
run: |
30-
pip install "celery==${{ celery-version }}"
36+
poetry run pip install "celery==${{ celery-version }}"
3137
3238
- name: Install Django
3339
run: |
34-
- pip install "django==${{ django-verrsion }}"
40+
poetry run pip install "django==${{ django-verrsion }}"
3541
3642
- name: Install dependencies
3743
run: |
@@ -40,5 +46,5 @@ jobs:
4046
4147
- name: Run tests
4248
run: |
43-
echo "Using celery version " `celery --version`
44-
pytest
49+
echo "Using celery version " `poetry run celery --version`
50+
poetry run pytest
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Publish Django Task API
5+
6+
on:
7+
release:
8+
types: [ created ]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.9
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install poetry
25+
poetry env use system
26+
poetry install
27+
28+
- name: Build and publish
29+
env:
30+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
31+
run:
32+
poetry publish --build

0 commit comments

Comments
 (0)