- name:Loop through each package directory, check if version has changed, build if changed, and then upload
run:|
for package_dir in ./*; do
if [ -d "$package_dir" ]; then
package_name=$(basename $package_dir)
if grep -q "$package_name" changed_files.txt; then
echo "Checking version for: $package_name"
if [ -f "$package_dir/pyproject.toml" ]; then
current_version=$(python -c "import toml; data = toml.load('$package_dir/pyproject.toml'); print(data['project']['version']) if 'project' in data and 'version' in data['project'] else print(None)")
last_version=$(git cat-file -p "$CI_COMMIT_BEFORE_SHA:$package_dir/pyproject.toml" | python -c "import sys, toml; data = toml.loads(sys.stdin.read()); print(data['project']['version']) if 'project' in data and 'version' in data['project'] else print(None)")