Skip to content

Commit

Permalink
Creating GH Actions Workflow to Publish @ PyPI
Browse files Browse the repository at this point in the history
rahulbordoloi authored Aug 18, 2024
1 parent 0ed5340 commit 921aa74
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish `Directory-Tree` to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:

publish-package:
runs-on: ubuntu-latest

steps:

# Checkout the Repository
- name: Check out the Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Set up `Python 3.9`
- name: Set up Python 3.9 for Actions
uses: actions/setup-python@v3
with:
python-version: '3.9'

# Upgrade `pip` and Install Build Dependencies
- name: Install Required Dependencies for Build
run: |
python -m pip install --upgrade pip
pip install build
# Build the Python Package
- name: Build the Python Package
run: python -m build

# Publish the Package to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 921aa74

Please sign in to comment.