Skip to content

Commit 36a187b

Browse files
committed
add publish task and fix workflow
1 parent 6fd7280 commit 36a187b

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,27 @@ name: publish
22

33
on:
44
release:
5-
types: [created]
5+
types:
6+
- published
67

78
jobs:
89
pypi:
910
runs-on: ubuntu-latest
1011

1112
steps:
12-
- name: Set up python
13-
uses: actions/setup-python@v2
14-
with:
15-
python-version: "3.6"
16-
17-
- name: Upgrade pip
18-
run: python -m pip install --upgrade pip
19-
20-
- name: Upgrade or install additional system packages
21-
run: pip install --upgrade setuptools virtualenv wheel
22-
2313
- name: Checkout repository
2414
uses: actions/checkout@v2
2515
with:
2616
fetch-depth: 0
2717

28-
- name: Install pep517 and twine
29-
run: pip install pep517 twine
30-
31-
- name: Build source and binary
32-
run: python -m pep517.build --source --binary .
18+
- name: Setup development environment
19+
uses: ./.github/actions/setup-dev-env
20+
with:
21+
python-version: "3.7"
3322

34-
- name: Upload to PyPI
23+
- name: Run unit tests
3524
env:
3625
TWINE_REPOSITORY: pypi
3726
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
3827
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
39-
run: twine upload dist/*
28+
run: doit publish

dodo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ def task_publishable():
7272
["check-wheel-contents", HERE / "dist"],
7373
],
7474
)
75+
76+
77+
def task_publish():
78+
task = task_publishable()
79+
task["actions"].append(["twine", "upload", *list((HERE / "dist").glob("*"))])
80+
return task

0 commit comments

Comments
 (0)