<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vinesh</title>
    <description>The latest articles on DEV Community by Vinesh (@cplkake).</description>
    <link>https://dev.to/cplkake</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3053529%2Fac4ab330-f5ac-4455-837d-6342c019b287.png</url>
      <title>DEV Community: Vinesh</title>
      <link>https://dev.to/cplkake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cplkake"/>
    <language>en</language>
    <item>
      <title>Publishing a LitePolis package to PyPI using Github Actions</title>
      <dc:creator>Vinesh</dc:creator>
      <pubDate>Thu, 17 Apr 2025 19:23:44 +0000</pubDate>
      <link>https://dev.to/cplkake/publishing-a-litepolis-package-to-pypi-using-github-actions-3643</link>
      <guid>https://dev.to/cplkake/publishing-a-litepolis-package-to-pypi-using-github-actions-3643</guid>
      <description>&lt;p&gt;The Python Package Index (PyPI) is the standard repository for distributing Python packages, enabling other developers to install your work with a simple &lt;code&gt;pip install&lt;/code&gt;. This tutorial walks you through publishing your LitePolis package to the PyPI using &lt;code&gt;pyproject.toml&lt;/code&gt; and Github Actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Automate Package Publishing
&lt;/h2&gt;

&lt;p&gt;Automating the PyPI packaging process with GitHub Actions and PyPI's Trusted Publishers brings about the following benefits:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Consistency and Reliability&lt;/strong&gt;&lt;br&gt;
Automation ensures that your package builds follow the same steps every time, creating a reliable process that produces identical distribution files regardless of who triggers it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Time Efficiency&lt;/strong&gt;&lt;br&gt;
Once set up, publishing becomes as simple as creating a new release in your repository. The workflow will handle building the source distributions and wheels, running pre-publish tests, and uploading the files to PyPI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Enhanced Security&lt;/strong&gt;&lt;br&gt;
With PyPI's Trusted Publisher feature, you can authorize GitHub Actions to publish packages directly to PyPI without storing API tokens or passwords as secrets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Version Control Integration&lt;/strong&gt;&lt;br&gt;
With GitHub Actions, your publishing workflow lives alongside your code, meaning changes to the build process are versioned, publishing history is visible in your repository's actions logs, and the entire process is transparent to contributors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Enhanced Collaboration&lt;/strong&gt;&lt;br&gt;
Team members can trigger releases without needing PyPI credentials on their machines. With Trusted Publishers, maintainers can authorize specific repositories and workflows to publish, making it easier to share responsibilities without sharing credentials.&lt;/p&gt;
&lt;h2&gt;
  
  
  Naming Convention
&lt;/h2&gt;

&lt;p&gt;To keep the LitePolis ecosystem easy-to-navigate, ensure that the name of your package adheres to the naming convention followed by LitePolis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LitePolis-&amp;lt;moduleType&amp;gt;-&amp;lt;module&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;moduleType&lt;/code&gt; is the category of the package. Must be one of:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ui&lt;/code&gt; for user interface packages&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;middleware&lt;/code&gt; for business logic or orchestration layers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;database&lt;/code&gt; for database integrations&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;module&lt;/code&gt; is the name of your specific extention&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;For example, if you are creating a package that adds support for the StarRocks database, name it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LitePolis-database-StarRocks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This convention helps developers immediately understand what the package does and how it fits into the LitePolis architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring your build backend and project metadata
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;pyproject.toml&lt;/code&gt; serves as a central place for your project's configuration. It tells the build frontend tool which backend is needed to build your package. Some available options include &lt;a href="https://hatch.pypa.io/latest/" rel="noopener noreferrer"&gt;Hatchling&lt;/a&gt;, &lt;a href="https://setuptools.pypa.io/en/latest/" rel="noopener noreferrer"&gt;Setuptools&lt;/a&gt;, &lt;a href="https://flit.pypa.io/en/latest/" rel="noopener noreferrer"&gt;Flit&lt;/a&gt;, or &lt;a href="https://pdm-project.org/en/latest/" rel="noopener noreferrer"&gt;PDM&lt;/a&gt;. Below is an example of a common build backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[build-system]&lt;/span&gt;
&lt;span class="py"&gt;requires&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"setuptools &amp;gt;= 61.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;build-backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"setuptools.build_meta"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuring metadata
&lt;/h3&gt;

&lt;p&gt;Ensure that your &lt;code&gt;pyproject.toml&lt;/code&gt; file has the following, modifying as needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[project]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"litepolis-database-StarRocks"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.0.3"&lt;/span&gt;
&lt;span class="py"&gt;authors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="err"&gt;{&lt;/span&gt; &lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Your name"&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The StarRocks database module for LitePolis"&lt;/span&gt;
&lt;span class="py"&gt;dependencies&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"fastapi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"sqlmodel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[project.license]&lt;/span&gt;
&lt;span class="py"&gt;text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"file: LICENSE"&lt;/span&gt;

&lt;span class="nn"&gt;[project.readme]&lt;/span&gt;
&lt;span class="py"&gt;file&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"README.md"&lt;/span&gt;
&lt;span class="py"&gt;content-type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"text/markdown"&lt;/span&gt;

&lt;span class="nn"&gt;[project.urls]&lt;/span&gt;
&lt;span class="py"&gt;Homepage&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://github.com/myGithubAccount/LitePolis-database-StarRocks"&lt;/span&gt;

&lt;span class="nn"&gt;[tool.setuptools]&lt;/span&gt;
&lt;span class="py"&gt;include-package-data&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

&lt;span class="nn"&gt;[tool.setuptools.packages.find]&lt;/span&gt;
&lt;span class="py"&gt;exclude&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"tests"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"docs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="py"&gt;namespaces&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;[project]&lt;/code&gt;&lt;br&gt;
The core metadata of your package. PyPI and other tools use this information when building, installing, and displaying your package.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt; is the distribution name of your package. Follow the LitePolis naming convention but use lowercase + dashes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;version&lt;/code&gt; is the current version of you package. Update this before each release.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;authors&lt;/code&gt; is the list of author(s). You can choose to include your email.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt; is a short summary of your package that will appear on PyPI.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dependencies&lt;/code&gt; are the runtime packages that your module needs to work. They will be installed automatically when someone installs your package via &lt;code&gt;pip&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;[project.license]&lt;/code&gt;&lt;br&gt;
Helps users understand how your code can be used or reused.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;text = "file: LICENSE"&lt;/code&gt; means the license is stored in a separate file named &lt;code&gt;LICENSE&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;[project.readme]&lt;/code&gt;&lt;br&gt;
Tells PyPI to use &lt;code&gt;README.md&lt;/code&gt; as the long description for your project.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[project.urls]&lt;/code&gt;&lt;br&gt;
Helpful links that appear on your PyPI project page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Homepage&lt;/code&gt; typically points to your GitHub repository, but you can also add Docs, Issues, Changelog, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;[tool.setuptools]&lt;/code&gt;&lt;br&gt;
Customize how &lt;strong&gt;setuptools&lt;/strong&gt; builds your package&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;include-package-data = false&lt;/code&gt; means non-code files won't be included in your package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;[tool.setuptools.packages.find]&lt;/code&gt;&lt;br&gt;
Controls how &lt;strong&gt;setuptools&lt;/strong&gt; finds your code to include in the package.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;exclude&lt;/code&gt; tells &lt;strong&gt;setuptools&lt;/strong&gt; not to include the specified folders.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;namespace = false&lt;/code&gt; signals that you are not using namespace packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Using PyPI Trusted Publishing
&lt;/h2&gt;

&lt;p&gt;PyPI Trusted Publishing lets you link your GitHub repository to your PyPI project. PyPI will then trust GithHub Actions to publish your package without the need of tokens when you create a new release from GitHub.&lt;/p&gt;
&lt;h3&gt;
  
  
  Create the Workflow File
&lt;/h3&gt;

&lt;p&gt;GitHub provides a convenient workflow template for publishing packages to PyPI. This template requires minimal configuration and handles most of the heavy-lifting for you.&lt;/p&gt;

&lt;p&gt;To get started, navigate to your repository on GitHub and follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the Actions tab at the top of your repository&lt;/li&gt;
&lt;li&gt;If you have not created any workflows yet, you will see a page with suggested workflow templates&lt;/li&gt;
&lt;li&gt;Otherwise, click on "&lt;strong&gt;New workflow&lt;/strong&gt;" to see the available templates&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You will now see a page titled "&lt;strong&gt;Choose a workflow&lt;/strong&gt;" with various template options. Choose the workflow template titled "&lt;strong&gt;Publish Python Package&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbiv9hz62pipezccxqpgx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbiv9hz62pipezccxqpgx.png" alt="Select the " width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking the "&lt;strong&gt;Configure&lt;/strong&gt;" button, GitHub will generate a workflow YAML file in your repository under the &lt;code&gt;.github/workflows&lt;/code&gt; directory, typically named &lt;code&gt;python-publish.yml&lt;/code&gt; (or whatever you want to call it). Here's what the default workflow file looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This workflow will upload a Python Package to PyPI when a release is created&lt;/span&gt;
&lt;span class="c1"&gt;# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries&lt;/span&gt;

&lt;span class="c1"&gt;# This workflow uses actions that are not certified by GitHub.&lt;/span&gt;
&lt;span class="c1"&gt;# They are provided by a third-party and are governed by&lt;/span&gt;
&lt;span class="c1"&gt;# separate terms of service, privacy policy, and support&lt;/span&gt;
&lt;span class="c1"&gt;# documentation.&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload Python Package&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;published&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;release-build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-python@v5&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;python-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3.x"&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build release distributions&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;# NOTE: put your own distribution build steps here.&lt;/span&gt;
          &lt;span class="s"&gt;python -m pip install build&lt;/span&gt;
          &lt;span class="s"&gt;python -m build&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload distributions&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-artifact@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;release-dists&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist/&lt;/span&gt;

  &lt;span class="na"&gt;pypi-publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;release-build&lt;/span&gt;
    &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="c1"&gt;# IMPORTANT: this permission is mandatory for trusted publishing&lt;/span&gt;
      &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

    &lt;span class="c1"&gt;# Dedicated environments with protections for publishing are strongly recommended.&lt;/span&gt;
    &lt;span class="c1"&gt;# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pypi&lt;/span&gt;
      &lt;span class="c1"&gt;# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:&lt;/span&gt;
      &lt;span class="c1"&gt;# url: https://pypi.org/p/YOURPROJECT&lt;/span&gt;
      &lt;span class="c1"&gt;#&lt;/span&gt;
      &lt;span class="c1"&gt;# ALTERNATIVE: if your GitHub Release name is the PyPI project version string&lt;/span&gt;
      &lt;span class="c1"&gt;# ALTERNATIVE: exactly, uncomment the following line instead:&lt;/span&gt;
      &lt;span class="c1"&gt;# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Retrieve release distributions&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/download-artifact@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;release-dists&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist/&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish release distributions to PyPI&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pypa/gh-action-pypi-publish@release/v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;packages-dir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to commit your change (adding this YAML workflow file) to the repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure PyPI
&lt;/h3&gt;

&lt;p&gt;If you have not already, register an account on PyPI at &lt;a href="https://pypi.org/manage/account/publishing/" rel="noopener noreferrer"&gt;https://pypi.org/manage/account/publishing/&lt;/a&gt; and complete the steps on the page. To create a PyPI project, go to &lt;a href="https://pypi.org/manage/account/publishing/" rel="noopener noreferrer"&gt;https://pypi.org/manage/account/publishing/&lt;/a&gt;, scroll to "&lt;strong&gt;Add a new pending publisher&lt;/strong&gt;" and fill in the following project details.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PyPI Project Name&lt;/strong&gt;: Make sure this matches exactly the one set in &lt;code&gt;[project.name]&lt;/code&gt; within your &lt;code&gt;pyproject.toml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Owner&lt;/strong&gt;: This should be the GitHub username or organization that owns the repository. It must match the owner shown on GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repository Name&lt;/strong&gt;: Enter the exact name of your GitHub repository (case-sensitive).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Name&lt;/strong&gt;: This is the name of the &lt;code&gt;.yml&lt;/code&gt; you file created for your GitHub Actions workflow (e.g. &lt;code&gt;python-publish.yml&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment Name&lt;/strong&gt;: Set this to &lt;code&gt;pypi&lt;/code&gt; (recommended but optional). Helps isolate and manage the publishing environment within GitHub Actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After you have clicked &lt;strong&gt;Add&lt;/strong&gt;, GitHub Actions (on your behalf) will now be a trusted publisher, automatically building your package, authenticating with PyPI via OpenID Connect (OIDC), and publishing your package when you create a new release on GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Triggering a PyPI Release
&lt;/h2&gt;

&lt;p&gt;Once your workflow is set up, publishing your LitePolis package to PyPI is as simple as creating a release on your GitHub repository. To create a new release from your repository:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on "&lt;strong&gt;Releases&lt;/strong&gt;" in your repository&lt;/li&gt;
&lt;li&gt;Click "&lt;strong&gt;Draft a new release&lt;/strong&gt;"&lt;/li&gt;
&lt;li&gt;Add a tag (e.g. "v1.0.0")&lt;/li&gt;
&lt;li&gt;Fill in the title and description&lt;/li&gt;
&lt;li&gt;Click "&lt;strong&gt;Publish release&lt;/strong&gt;"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it! Your GitHub Actions workflow will take over, building your LitePolis package and publishing it to PyPI using Trusted Publishing.&lt;/p&gt;

&lt;p&gt;🎉 Congrats! You're officially a LitePolis publisher on PyPI!&lt;/p&gt;

</description>
      <category>litepolis</category>
      <category>python</category>
      <category>githubactions</category>
      <category>pypi</category>
    </item>
  </channel>
</rss>
