Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions scripts/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,34 @@ if [ "$previous_tag" = "none" ]; then
echo "No version tags found; bootstrapping $INITIAL_VERSION_TAG on first commit $first_commit"

echo "Pushing tag $INITIAL_VERSION_TAG"
git push -f origin "${INITIAL_VERSION_TAG}"
git push origin "${INITIAL_VERSION_TAG}"
fi

# Create a new version tag.
uv run python -m semantic_release -vv version
# Use semantic-release to determine next version and create tag
echo "Using semantic-release to determine next version and create tag..."
uv run python -m semantic_release -v version --skip-build --no-commit

# Get the new tag
new_tag="$(git describe --tags --abbrev=0 2>/dev/null || echo none)"

# Determine if a release was created.
released=false
tag=""
if [ "$new_tag" != "none" ] && [ "$new_tag" != "$previous_tag" ] && [ "$new_tag" != "${INITIAL_VERSION_TAG}" ]; then
if [ -n "$new_tag" ] && [ "$new_tag" != "none" ] && [ "$new_tag" != "$previous_tag" ] && [ "$new_tag" != "${INITIAL_VERSION_TAG}" ]; then
released=true
tag="$new_tag"
echo "New tag was created (new_tag=$new_tag, previous_tag=$previous_tag)"
else
echo "No new tag was created (new_tag=$new_tag, previous_tag=$previous_tag)"
git --no-pager log --pretty=format:'%h %s' "${INITIAL_VERSION_TAG}..HEAD" | sed -n '1,50p'
if [ "$previous_tag" != "none" ]; then
git --no-pager log --pretty=format:'%h %s' "${previous_tag}..HEAD" | sed -n '1,50p'
fi
fi

if [ -z "$GITHUB_OUTPUT" ]; then
echo "GITHUB_OUTPUT is not set"
exit 1
echo "GITHUB_OUTPUT is not set - running in local development mode"
echo "released=$released"
echo "tag=$new_tag"
exit 0
fi

echo "released=$released" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "tag=$new_tag" >> "$GITHUB_OUTPUT"
9 changes: 7 additions & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
dist_path="dist"
tag="${1}"

if [ -z "$tag" ]; then
echo "Tag is required"
if [ -z "$tag" ] || [ "$tag" = "none" ]; then
echo "Valid tag is required (got: '$tag')"
exit 1
fi

echo "Publishing distribution artifacts to GitHub Release $tag"

# Ensure distribution artifacts exist. Add more files if you have them.
if [ ! -d "$dist_path" ]; then
echo "Distribution directory $dist_path does not exist"
exit 1
fi

ls -lah "$dist_path"

# Upload distribution artifacts to GitHub Release (idempotent if re-run).
Expand Down