Skip to content

Commit

Permalink
Merge pull request #47 from Vik-it99/C2DEVEL-16327
Browse files Browse the repository at this point in the history
C2DEVEL-16327: build and publish to PyPi
  • Loading branch information
Sharpeye90 authored Dec 22, 2024
2 parents 4013628 + c787b6a commit 2739917
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish python distribution to PyPI

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: "distributions-for-${{ github.event.release.tag_name }}"
path: dist/

publish-to-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Download distributions
uses: actions/download-artifact@v4
with:
name: "distributions-for-${{ github.event.release.tag_name }}"
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
repository-url: https://pypi.org/legacy/
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 2739917

Please sign in to comment.