Skip to content

Commit 9bf3682

Browse files
committed
add renamed file
1 parent c69083b commit 9bf3682

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scripts/cd.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Check all pyproject.toml files that have changed
4+
for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
5+
# Extract the current version and build the expected tag
6+
dirpath=$(dirname $file)
7+
expected_tag=$(scripts/helper.sh $dirpath --path-version)
8+
version=$(scripts/helper.sh $dirpath)
9+
# Check if the tag already exists
10+
if git rev-parse --verify $expected_tag^{tag} &> /dev/null; then
11+
echo "Tag '$expected_tag' already exists."
12+
else
13+
# Tag doesn't exist. Create tag and build/publish to PyPi
14+
echo "Tag '$expected_tag' does not exist. Creating new tag to trigger release."
15+
git tag -a $expected_tag -m "Release $version"
16+
git push origin tag $expected_tag
17+
poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
18+
fi
19+
done

0 commit comments

Comments
 (0)