Skip to content

Commit af16ede

Browse files
committed
feat: re-add release
1 parent d7c2161 commit af16ede

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
ci:
10+
uses: ./.github/workflows/semantic_release.yml # Uses a different workflow file
11+
12+
release:
13+
needs: ci # Wait for CI to complete
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.9'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
30+
- name: Update version files
31+
run: |
32+
# Extract version from GitHub release tag (removes 'v' prefix if present)
33+
VERSION=${GITHUB_REF#refs/tags/}
34+
VERSION=${VERSION#v}
35+
echo "Extracted version: ${VERSION}"
36+
echo "Updating version to: ${VERSION}"
37+
38+
# Update pyproject.toml
39+
sed -i "s/version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
40+
41+
# Update __init__.py (fixed path)
42+
sed -i "s/__version__ = \".*\"/__version__ = \"${VERSION}\"/" tqdm_pandas/__init__.py
43+
44+
# Verify updates
45+
echo "pyproject.toml version:"
46+
grep 'version = ' pyproject.toml
47+
echo "__init__.py version:"
48+
grep '__version__' tqdm_pandas/__init__.py
49+
50+
- name: Clean previous builds
51+
run: rm -rf dist/ build/ *.egg-info/
52+
53+
- name: Build package
54+
run: |
55+
python -m build
56+
echo "Built files:"
57+
ls -la dist/
58+
59+
- name: Check package
60+
run: twine check dist/*
61+
62+
- name: Publish to PyPI
63+
env:
64+
TWINE_USERNAME: __token__
65+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
66+
run: twine upload dist/* --verbose

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@ allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style",
5757
minor_tags = ["feat"]
5858
patch_tags = ["fix", "perf"]
5959

60+
[tool.semantic_release.publish]
61+
dist_glob_patterns = ["dist/*"]
62+
upload_to_vcs_release = true
63+
6064

0 commit comments

Comments
 (0)