-
Notifications
You must be signed in to change notification settings - Fork 0
Improve workflow to deploy build versions to Pypi #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 introduces automated workflow improvements for building and releasing feature branch versions to TestPyPI. The changes establish a CI/CD pipeline that automatically creates incremental build versions (e.g., "0.1.12-build.1") for feature branches and publishes them to TestPyPI for testing purposes.
Key changes:
- Added automated build version detection and increment logic
- Created a GitHub Actions workflow for TestPyPI releases on feature branches
- Implemented version management with automatic package versioning
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
.github/workflows/scripts/get_latest_build.sh |
Bash script that queries TestPyPI API to detect existing build versions and generates the next incremental build number |
.github/workflows/release-test-pypi.yml |
GitHub Actions workflow that runs tests, builds packages, and publishes feature branch builds to TestPyPI |
Comments suppressed due to low confidence (1)
.github/workflows/release-test-pypi.yml:15
- Python 3.13 may not be available yet. As of my knowledge cutoff in January 2025, Python 3.13 was still in development. Consider using a stable version like "3.12" or "3.11" to ensure compatibility.
PYTHON_VERSION: "3.13"
|
||
# Get the latest build version and its filename | ||
LATEST_BUILD_VERSION=$(echo "$BUILD_VERSIONS" | tail -n 1) | ||
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get('$LATEST_BUILD_VERSION', [])]" 2>/dev/null || echo "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $LATEST_BUILD_VERSION
inside the Python string is not being expanded by the shell because it's within single quotes in the Python code. This will cause the script to look for a literal key '$LATEST_BUILD_VERSION' instead of the actual version value. Use double quotes or concatenate the variable outside the Python string.
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get('$LATEST_BUILD_VERSION', [])]" 2>/dev/null || echo "") | |
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get(\"$LATEST_BUILD_VERSION\", [])]" 2>/dev/null || echo "") |
Copilot uses AI. Check for mistakes.
if [ -n "$BUILD_NUMBERS" ]; then | ||
LATEST_BUILD_NUMBER=$(echo "$BUILD_NUMBERS" | tail -n 1) | ||
BUILD_NUMBER=$((LATEST_BUILD_NUMBER + 1)) | ||
echo "Found build numbers: $(echo $BUILD_NUMBERS | tr '\n' ' ')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $BUILD_NUMBERS
should be quoted to prevent word splitting. Change to echo "$BUILD_NUMBERS"
to avoid potential issues with spaces in the output.
echo "Found build numbers: $(echo $BUILD_NUMBERS | tr '\n' ' ')" | |
echo "Found build numbers: $(echo "$BUILD_NUMBERS" | tr '\n' ' ')" |
Copilot uses AI. Check for mistakes.
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | ||
echo "latest_build_number=1" >> $GITHUB_OUTPUT | ||
echo "latest_build_filename=" >> $GITHUB_OUTPUT | ||
echo "build_count=0" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $GITHUB_OUTPUT
should be quoted to prevent potential issues with special characters or spaces in the path. Change to "$GITHUB_OUTPUT"
for safer file operations.
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
echo "latest_build_number=1" >> $GITHUB_OUTPUT | |
echo "latest_build_filename=" >> $GITHUB_OUTPUT | |
echo "build_count=0" >> $GITHUB_OUTPUT | |
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
echo "latest_build_number=1" >> "$GITHUB_OUTPUT" | |
echo "latest_build_filename=" >> "$GITHUB_OUTPUT" | |
echo "build_count=0" >> "$GITHUB_OUTPUT" |
Copilot uses AI. Check for mistakes.
No description provided.