Skip to content

Commit e6d7523

Browse files
committed
OpenConceptLab/ocl_issues#1909 | github actions job to publish to pypi
1 parent 7c0df35 commit e6d7523

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

.github/workflows/python-app.yml

+27-10
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
build:
17-
16+
test:
1817
runs-on: ubuntu-latest
19-
2018
steps:
2119
- uses: actions/checkout@v3
2220
- name: Set up Python 3.10
@@ -27,14 +25,33 @@ jobs:
2725
run: |
2826
python setup.py install
2927
pip install six
30-
# pip install flake8 pytest
31-
# - name: Lint with flake8
32-
# run: |
33-
# # stop the build if there are Python syntax errors or undefined names
34-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3728
- name: Unittest
3829
run: |
3930
python -m unittest ocldev/tests/*.py
31+
pypi-publish:
32+
needs: [test]
33+
name: Publish to PyPi
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/ocldev
38+
permissions:
39+
id-token: write
40+
steps:
41+
- uses: actions/checkout@v3
42+
- name: Set up Python 3.10
43+
uses: actions/setup-python@v3
44+
with:
45+
python-version: "3.10"
46+
- name: Install dependencies
47+
run: |
48+
pip install --upgrade pip --user
49+
pip install setuptools==44.1.0 --user
50+
pip install twine==1.15.0 --user
51+
- name: Build Wheel
52+
run: |
53+
python setup.py sdist bdist_wheel --universal
54+
twine check dist/*
55+
- name: Publish package distributions to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
4057

0 commit comments

Comments
 (0)