8 Commits
v0.2.0 ... main

Author SHA1 Message Date
f63ef85dd7 chore(changelog): update unreleased changelog 2025-05-11 13:35:57 +00:00
c2013fc205 chore(scripts): update file mode to make script executable
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 8s
Build and Publish nightly package / build-and-publish (push) Successful in 19s
- Changes file mode from 644 to 755 to allow script execution
- Ensures proper permissions for usage in relevant environments
2025-05-11 15:35:41 +02:00
e5015ec2f3 chore(changelog): update unreleased changelog 2025-05-11 13:35:06 +00:00
1163744af9 chore(scripts): rename cleanup script for broader usage
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 8s
Build and Publish nightly package / build-and-publish (push) Failing after 17s
- Renames the cleanup_dev_versions script to cleanup_versions
2025-05-11 15:34:51 +02:00
e3c703aa32 chore(changelog): update unreleased changelog 2025-05-11 13:33:50 +00:00
aff319cc5f feat(workflows): add cleanup step for old dev versions
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 5s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 8s
Build and Publish nightly package / build-and-publish (push) Failing after 16s
- Introduces a step to remove old development versions using a script
- Helps maintain a cleaner environment during nightly builds
2025-05-11 15:33:35 +02:00
fc8b885214 feat(scripts): add script to clean old PyPI dev versions
- Introduces a Bash script to delete outdated PyPI dev versions
  from the Gitea package registry while keeping the latest version
- Uses environment variables for authentication and repository details
2025-05-11 15:33:35 +02:00
7067f0872b chore(gitignore): update ignored files for environment and build
- Add `.env` files to the ignore list to exclude environment configs
- Retain `dist/` directory in the ignore list for build artifacts
2025-05-11 15:33:35 +02:00
4 changed files with 67 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
# cleanup_dev_versions.sh - Delete old PyPI dev versions from Gitea package registry
# Required environment variables
USERNAME="${TWINE_USERNAME}"
TOKEN="${TWINE_PASSWORD}"
REPO="${GITHUB_REPOSITORY}" # e.g., maxp/repocat
API_BASE="${GITHUB_API_URL%/}" # Strip trailing slash if present
OWNER="${REPO%%/*}"
PACKAGE_NAME="${REPO##*/}"
API_URL="${API_BASE}/packages/${OWNER}/pypi/${PACKAGE_NAME}"
# Fetch the list of versions
response=$(curl -s -u "$USERNAME:$TOKEN" "$API_URL")
# Extract all .dev versions, sort by creation time
mapfile -t versions_to_delete < <(echo "$response" | jq -r '
map(select(.version | test("\\.dev"))) |
sort_by(.created_at) |
.[0:-1][] |
.version')
# Determine latest version to keep
latest_version=$(echo "$response" | jq -r '
map(select(.version | test("\\.dev"))) |
sort_by(.created_at) |
last.version')
if [[ -z "$latest_version" || ${#versions_to_delete[@]} -eq 0 ]]; then
echo "No old .dev versions to delete."
exit 0
fi
echo "Keeping latest .dev version: $latest_version"
# Delete old .dev versions
for version in "${versions_to_delete[@]}"; do
echo "Deleting old .dev version: $version"
curl -s -X DELETE -u "$USERNAME:$TOKEN" "$API_URL/$version"
done
echo "Cleanup complete."

View File

@@ -53,3 +53,10 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
poetry run twine upload --repository-url ${{ secrets.TWINE_URL }} dist/*
- name: Cleanup old dev versions
run: |
.gitea/scripts/cleanup_versions.sh '\.dev'
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*__pycache__*
dist/
**/.env

View File

@@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file.
## [unreleased]
### 🚀 Features
- *(workflows)* Add cleanup step for old dev versions - ([aff319c](https://git.0xmax42.io/maxp/repoCat/commit/aff319cc5f5c8f954367a6a6b89c84ece6b19f4e))
- *(scripts)* Add script to clean old PyPI dev versions - ([fc8b885](https://git.0xmax42.io/maxp/repoCat/commit/fc8b885214b1f5b1d9dcff20612a583aca89f6f9))
### ⚙️ Miscellaneous Tasks
- *(scripts)* Update file mode to make script executable - ([c2013fc](https://git.0xmax42.io/maxp/repoCat/commit/c2013fc20538a377fc5de45bd384b6ac438fb61c))
- *(scripts)* Rename cleanup script for broader usage - ([1163744](https://git.0xmax42.io/maxp/repoCat/commit/1163744af9a3d908d6e7dbb716818bd67ec76a63))
- *(gitignore)* Update ignored files for environment and build - ([7067f08](https://git.0xmax42.io/maxp/repoCat/commit/7067f0872bdd8b456d52b3f9dab4834fd0798977))
## [0.2.0](https://git.0xmax42.io/maxp/repoCat/compare/v0.1.0..v0.2.0) - 2025-05-11
### 🚀 Features