-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcd.sh
More file actions
executable file
·25 lines (23 loc) · 996 Bytes
/
cd.sh
File metadata and controls
executable file
·25 lines (23 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Immediate exit on failure
set -e
# Check all pyproject.toml files that have changed
for file in $(find . -print | sed 's|^./||' | grep -E "(^services/[^/]+/pyproject.toml$|^core/pyproject.toml$)"); do
# Extract the current version and build the expected tag
dirpath=$(dirname $file)
expected_tag=$(scripts/helper.sh $dirpath --path-version)
version=$(scripts/helper.sh $dirpath)
# Check if the tag already exists
if git rev-parse --verify $expected_tag^{tag} &> /dev/null; then
echo "Tag '$expected_tag' already exists."
else
# Tag doesn't exist. Create tag and build/publish to PyPi
echo "Tag '$expected_tag' does not exist. Creating new tag to trigger release."
git tag -a $expected_tag -m "Release $version"
git push origin tag $expected_tag
cd $dirpath
uv build
uv publish --username="__token__" --password="$PYPI_TOKEN"
cd $GITHUB_WORKSPACE
fi
done