Skip to content

Commit dd4e944

Browse files
jnnsbrrjnnsbrr
authored andcommitted
revise release workflow
1 parent 88c1c8f commit dd4e944

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

scripts/release.sh

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,7 @@ echo "Creating local release for version: $VERSION"
2525
CURRENT_BRANCH=$(git branch --show-current)
2626
echo "Current branch: $CURRENT_BRANCH"
2727

28-
# 1. Update CITATION.cff with the specified version
29-
echo "Updating CITATION.cff..."
30-
python3 scripts/update_citation.py "$VERSION"
31-
32-
# Check if CITATION.cff was updated
33-
if ! git diff --quiet CITATION.cff; then
34-
echo "CITATION.cff updated, committing changes..."
35-
git add CITATION.cff
36-
git commit -m "Update CITATION.cff to version $VERSION"
37-
echo "CITATION.cff changes committed successfully."
38-
else
39-
echo "No changes to CITATION.cff needed."
40-
fi
41-
42-
# 2. Format code with black
28+
# 1. Format code with black
4329
echo "Formatting code with black..."
4430
python3 -m black ./
4531
if [ $? -ne 0 ]; then
@@ -66,11 +52,26 @@ if [ $? -ne 0 ]; then
6652
fi
6753
echo "Linting passed successfully."
6854

69-
# 5. Create the tag
55+
# 5. Update CITATION.cff and commit changes (only after all checks pass)
56+
echo "Updating CITATION.cff..."
57+
python3 scripts/update_citation.py "$VERSION"
58+
59+
if ! git diff --quiet CITATION.cff; then
60+
echo "CITATION.cff updated, committing changes..."
61+
git add CITATION.cff
62+
git commit -m "Release version $VERSION
63+
64+
- Update CITATION.cff to version $VERSION"
65+
echo "CITATION.cff changes committed successfully."
66+
else
67+
echo "No changes to CITATION.cff needed."
68+
fi
69+
70+
# 6. Create the tag
7071
echo "Creating tag v$VERSION..."
7172
git tag "v$VERSION"
7273

73-
# 6. Show what was done
74+
# 7. Show what was done
7475
echo ""
7576
echo "Local release completed for version $VERSION!"
7677
echo ""

tests/test_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pycoupler.run import submit_lpjml
22
import pytest
33
from subprocess import CalledProcessError
4+
import pytest_subprocess # noqa: F401
45

56

67
class TestLpjSubmit:

0 commit comments

Comments
 (0)