Skip to content

Commit

Permalink
Add github workflow to release to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
kayoMichael committed Dec 24, 2024
1 parent fa7fa39 commit 3330851
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3330851

Please sign in to comment.