Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1909 | github actions job to publish to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Aug 1, 2024
1 parent 7c0df35 commit e6d7523
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ permissions:
contents: read

jobs:
build:

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
Expand All @@ -27,14 +25,33 @@ jobs:
run: |
python setup.py install
pip install six
# pip install flake8 pytest
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Unittest
run: |
python -m unittest ocldev/tests/*.py
pypi-publish:
needs: [test]
name: Publish to PyPi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ocldev
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip --user
pip install setuptools==44.1.0 --user
pip install twine==1.15.0 --user
- name: Build Wheel
run: |
python setup.py sdist bdist_wheel --universal
twine check dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit e6d7523

Please sign in to comment.