Skip to content

Commit

Permalink
Merge pull request #30 from tuftsceeo/dev/nick
Browse files Browse the repository at this point in the history
Update release-render-pipeline.yml
  • Loading branch information
NicK4rT authored Dec 4, 2024
2 parents f541f8e + 9b71849 commit 17354f6
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/release-render-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ jobs:
all_changed_files=$(echo "$changed_files $new_files" | tr ' ' '\n')

# Read the current version dictionary from config.py
python3 -c "from software.release.config import version; print(version)" > current_version.json
python3 -c |
from software.release.config import version
import json
print(version) > current_version.json

# Debugging: Check the content of current_version.json
echo "Current version data:"
Expand All @@ -88,27 +91,33 @@ jobs:
# Check if the file exists in the version dictionary
if grep -q "$base_file" current_version.json; then
# Get the current version number
current_version=$(python3 -c "from software.release.config import version; print(version.get('$base_file', 0))")

current_version=$(python3 -c |
from software.release.config import version
print(version.get('$base_file', 0)))

# Debugging: Check current version
echo "Current version for $base_file: $current_version"

# Increment the version number by 1
new_version=$((current_version + 1))
python3 -c "from software.release.config import version; \
version['$base_file'] = $new_version; \
import json; \
with open('software/release/config.py', 'w') as f: json.dump(version, f, indent=4)"

python3 -c |
from software.release.config import version
import json
version['$base_file'] = $new_version
with open('software/release/config.py', 'w') as f:
json.dump(version, f, indent=4)

# Debugging: Print the file name and updated version
echo "Updated $base_file version from $current_version to $new_version"
else
# Add the file with version 1 if it's not already in the dictionary
python3 -c "from software.release.config import version; \
version['$base_file'] = 1; \
import json; \
with open('software/release/config.py', 'w') as f: json.dump(version, f, indent=4)"

python3 -c |
from software.release.config import version
import json
version['$base_file'] = 1
with open('software/release/config.py', 'w') as f:
json.dump(version, f, indent=4)

# Debugging: Print that the file was added with version 1
echo "Added $base_file with version 1"
fi
Expand Down

0 comments on commit 17354f6

Please sign in to comment.