Skip to content

Commit 17b1316

Browse files
committed
Add publish-to-pypi job to workflow
1 parent 83b1db4 commit 17b1316

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

.github/workflows/main.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: test
2-
run-name: Test
3-
on: [ push ]
1+
name: Test and Deploy
2+
on: push
43
jobs:
54
test:
5+
name: Test
66
strategy:
77
fail-fast: false
88
matrix:
@@ -31,3 +31,31 @@ jobs:
3131

3232
- name: Run tests
3333
run: make test
34+
35+
publish-to-pypi:
36+
name: Build and Publish to PyPI
37+
needs:
38+
- test
39+
if: github.ref == 'refs/heads/master'
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/fast-plate-ocr
44+
permissions:
45+
id-token: write
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- name: Install poetry
50+
run: pipx install poetry
51+
52+
- name: Setup Python
53+
uses: actions/setup-python@v3
54+
with:
55+
python-version: '3.10'
56+
57+
- name: Build a binary wheel
58+
run: poetry build
59+
60+
- name: Publish distribution 📦 to PyPI
61+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)