Skip to content

Commit daf94d9

Browse files
committed
ci: add manual PyPI publish workflow and update version
1 parent 02a6163 commit daf94d9

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Manual Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to publish (without v prefix, e.g. 1.2.5)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
manual-publish:
16+
runs-on: ubuntu-latest
17+
environment:
18+
name: pypi
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
28+
- name: Verify version matches
29+
run: |
30+
VERSION=$(grep -m 1 "version = " pyproject.toml | sed 's/version = "\(.*\)"/\1/')
31+
echo "Version in pyproject.toml: $VERSION"
32+
echo "Version requested: ${{ github.event.inputs.version }}"
33+
if [ "$VERSION" != "${{ github.event.inputs.version }}" ]; then
34+
echo "::error::Version mismatch! pyproject.toml has $VERSION but requested ${{ github.event.inputs.version }}"
35+
exit 1
36+
fi
37+
38+
- name: Install build
39+
run: |
40+
python -m pip install --upgrade pip
41+
python -m pip install build
42+
43+
- name: Build package
44+
run: python -m build
45+
46+
- name: Verify distribution files
47+
run: |
48+
echo "Generated distribution files:"
49+
ls -la dist/
50+
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
password: ${{ secrets.PYPI_TOKEN }}
55+
packages-dir: dist/
56+
verbose: true
57+
58+
- name: Verify publication
59+
run: |
60+
echo "Waiting for PyPI to index the package..."
61+
sleep 30
62+
63+
# Use pip to verify the version is available
64+
python -m pip install commitloom==${{ github.event.inputs.version }} --no-deps
65+
INSTALLED_VERSION=$(python -c "import commitloom; print(commitloom.__version__)")
66+
67+
echo "Installed version: $INSTALLED_VERSION"
68+
if [ "$INSTALLED_VERSION" == "${{ github.event.inputs.version }}" ]; then
69+
echo "✅ Publication successful!"
70+
else
71+
echo "⚠️ Publication may have failed or not indexed yet"
72+
fi

commitloom/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .core.git import GitError, GitFile, GitOperations
66
from .services.ai_service import AIService, CommitSuggestion, TokenUsage
77

8-
__version__ = "0.1.0"
8+
__version__ = "1.2.5"
99
__author__ = "Petru Arakiss"
1010
__email__ = "petruarakiss@gmail.com"
1111

0 commit comments

Comments
 (0)