Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
khushaljethava authored Dec 27, 2024
1 parent 42850bc commit b63f6d7
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: pypi
name: publish

on:
release:
types: [created]
push:
tags:
- 'v*.*.*'

jobs:
deploy:
runs-on: ubuntu-latest
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/* --verbose
steps:
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install wheel
pip install twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

0 comments on commit b63f6d7

Please sign in to comment.