File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments