DEV Community

Cover image for Using GitHub Actions - Publish sdist on PyPi
Priyanshu Agarwal
Priyanshu Agarwal

Posted on

1

Using GitHub Actions - Publish sdist on PyPi

My Workflow

How boring would it be to build a software distribution of the package and upload it to PyPi after each release? This is where this workflow comes into play, automating tedious and repetitive tasks.

I created a workflow to automatically build the Python software distribution and publish it on PyPi after every release.

Building wheels is very tricky and often fails due to unforeseen circumstances. This workflow is triggered only after the wheel building procedure has been successfully completed. The sdist (software distribution) can also be tested on TestPyPi before releasing the sdist to production via workflow dispatch.

Actions used

  • actions/checkout
  • actions/setup-python
  • actions/upload-artifact
  • actions/download-artifact
  • pypa/gh-action-pypi-publish

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

Additional Resources / Info

This workflow is currently being utilized by PyBaMM to build their software distribution on PyPi, which is then picked up by the web service of conda-forge, which bumps the version of PyBaMM on conda-forge automatically.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay