Skip to content

Commit

Permalink
Merge pull request #32 from Abarvisionco/main
Browse files Browse the repository at this point in the history
Set up GitHub Actions for Automatic PyPI Publishing
  • Loading branch information
ProdByGodfather authored Jan 8, 2025
2 parents 03103b2 + ee2eadc commit 5e5d7a2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to PyPI

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8

# Install dependencies for building and publishing
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
# Extract version from setup.py
- name: Extract version from setup.py
id: extract_version
run: |
version=$(python -c "exec(open('setup.py').read()); print(__version__)")
echo "VERSION=$version" >> $GITHUB_ENV
# Log the extracted version
- name: Show extracted version
run: echo "Extracted Version: ${{ env.VERSION }}"

# Build the package
- name: Build the package
run: python -m build

# Publish to PyPI
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from setuptools import setup, find_packages

__version__ = '5.0.3'

setup(
name='abarorm',
version='5.0.2',
version=__version__,
description='abarorm is a lightweight and easy-to-use Object-Relational Mapping (ORM) library for SQLite and PostgreSQL databases in Python. It aims to provide a simple and intuitive interface for managing database models and interactions.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 5e5d7a2

Please sign in to comment.