Skip to content

Conversation

Perdiga
Copy link
Collaborator

@Perdiga Perdiga commented Jul 28, 2025

No description provided.

Perdiga and others added 3 commits July 28, 2025 15:28
- Bump version to 0.3.0.dev1
- Update package metadata

Version Bumped via GitHub Actions
- Create `release-prepare.yml` for automated version bumping and PR creation.
- Create `release-publish.yml` for publishing releases to PyPI after merging PRs.
- Remove the old `release.yml` workflow to streamline the release process.
- Implement `get_next_release_version.sh` script to determine the next version based on increment type.
- Add `test-publish.yml` for building and publishing development versions to TestPyPI.
@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 20:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the workflow system by transitioning from build-style versioning to development-style versioning and splitting the release process into two separate workflows for better control and reliability.

  • Migrated from "build" versioning (e.g., 0.3.0-build.1) to "dev" versioning (e.g., 0.3.0.dev1) for test releases
  • Split the monolithic release workflow into separate "prepare" and "publish" workflows
  • Added automated version determination script for consistent release management

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pyproject.toml Updates project version to development format (0.3.0.dev1)
.github/workflows/test-publish.yml Updates workflow name and comments to reflect dev versioning
.github/workflows/scripts/get_next_release_version.sh New script for automatic version determination using PyPI and git tags
.github/workflows/scripts/get_latest_build.sh Updates build detection logic to use dev versioning format
.github/workflows/release.yml Removes old monolithic release workflow
.github/workflows/release-publish.yml New workflow for automated publishing after PR merge
.github/workflows/release-prepare.yml New workflow for preparing releases with PR-based approval

# - increment_type: The type of increment applied
# - is_initial_release: Whether this is the first release

set -euo pipefail # Exit on error, undefined vars, pipe failures
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script uses 'set -euo pipefail' but later uses constructs like '|| echo ""' which can bypass the pipefail setting. Consider using explicit error handling instead of relying on command substitution with fallbacks.

Copilot uses AI. Check for mistakes.

Comment on lines +39 to +40
if PYPI_DATA=$(curl -s -f "https://pypi.org/pypi/${PACKAGE_NAME}/json" 2>/dev/null); then
LATEST_RELEASE_VERSION=$(echo "$PYPI_DATA" | python3 -c "import sys, json; data=json.load(sys.stdin); print(data.get('info', {}).get('version', ''))" 2>/dev/null || echo "")
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl command suppresses all error output with '2>/dev/null', making it difficult to debug network or API issues. Consider logging curl errors to help with troubleshooting.

Suggested change
if PYPI_DATA=$(curl -s -f "https://pypi.org/pypi/${PACKAGE_NAME}/json" 2>/dev/null); then
LATEST_RELEASE_VERSION=$(echo "$PYPI_DATA" | python3 -c "import sys, json; data=json.load(sys.stdin); print(data.get('info', {}).get('version', ''))" 2>/dev/null || echo "")
if PYPI_DATA=$(curl -s -f "https://pypi.org/pypi/${PACKAGE_NAME}/json"); then
LATEST_RELEASE_VERSION=$(echo "$PYPI_DATA" | python3 -c "import sys, json; data=json.load(sys.stdin); print(data.get('info', {}).get('version', ''))" 2>/dev/null || echo "")
else
echo "Error: Failed to fetch data from PyPI for package '${PACKAGE_NAME}'" >&2
fi

Copilot uses AI. Check for mistakes.


# Get all tags that look like semantic versions (v1.2.3 or 1.2.3)
if command -v git >/dev/null 2>&1; then
LATEST_TAG=$(git tag -l | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V | tail -n 1 || echo "")
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command chains multiple processes unnecessarily. Consider using 'git tag -l --sort=-version:refname' with appropriate patterns to get the latest tag more efficiently.

Suggested change
LATEST_TAG=$(git tag -l | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V | tail -n 1 || echo "")
LATEST_TAG=$(git tag -l --sort=-version:refname 'v[0-9]*.[0-9]*.[0-9]*' | head -n 1 | sed 's/^v//' || echo "")

Copilot uses AI. Check for mistakes.

@Perdiga Perdiga merged commit 1d604b3 into main Jul 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants