Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to PyPI

on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0, v0.1.2, etc.

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/polymathic-aion
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build

- name: Build package
run: python -m build

- name: Verify version matches tag
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
PACKAGE_VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())")
echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Version mismatch! Tag: $TAG_VERSION, Package: $PACKAGE_VERSION"
exit 1
fi

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# This action uses OIDC trusted publishing - no API tokens needed!
# Just configure your PyPI project to trust this GitHub repository
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=61"]
requires = ["setuptools>=61", "setuptools_scm>=8.0"]
build-backend = "setuptools.build_meta"

[project]
name = "aion"
version = "0.0.1"
dynamic = ["version"]
description = "AstronomIcal Omnimodal Network"
requires-python = ">=3.10"
dependencies = [
Expand Down Expand Up @@ -43,3 +43,9 @@ ignore = ["F722"]
[tool.setuptools.packages.find]
include = ["aion*"]
# Only include the 'aion' package and its subpackages

[tool.setuptools_scm]
# This section configures setuptools_scm
# It will use git tags to determine version numbers
# If no tags exist, it will use 0.1.dev0+g<commit_hash>
fallback_version = "0.1.dev0"
Loading