diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..279bcd4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Upload Python Package to PyPI + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/p/premier_league + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ \ No newline at end of file diff --git a/setup.py b/setup.py index 702dae6..4d748ba 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,8 @@ version="0.1", author="Michael Li", description="Premier League data Scrapping package", - packages=find_packages(), + packages=['premier_league', 'premier_league.players', 'premier_league.ranking', + 'premier_league.transfers', 'premier_league.utils'], install_requires=[ 'reportlab==4.0.4', 'requests>=2.28.1',