chore: update workflows

This commit is contained in:
Stevan Freeborn
2026-03-25 20:28:23 -05:00
parent 1ee50e83ca
commit 8116d0a362
3 changed files with 18 additions and 10 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
name: CI
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
branches: [main]
env:
+1
View File
@@ -1,5 +1,6 @@
name: Release
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
+14 -6
View File
@@ -1,5 +1,6 @@
name: Version
on:
workflow_dispatch:
push:
branches: [main]
permissions:
@@ -19,22 +20,29 @@ jobs:
run: |
tag=$(git tag -l 'v*' --sort=-v:refname | head -n1)
if [ -z "$tag" ]; then
tag="v0.0.0"
fi
echo "tag=" >> "$GITHUB_OUTPUT"
echo "No existing tags found"
else
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "Latest tag: $tag"
fi
- name: Determine version bump from commits
id: bump
run: |
latest_tag="${{ steps.latest_tag.outputs.tag }}"
# First release: publish 0.0.0 without bumping
if [ -z "$latest_tag" ]; then
echo "version=0.0.0" >> "$GITHUB_OUTPUT"
echo "skip=false" >> "$GITHUB_OUTPUT"
echo "First release: v0.0.0"
exit 0
fi
current="${latest_tag#v}"
IFS='.' read -r major minor patch <<< "$current"
if git rev-parse "$latest_tag" >/dev/null 2>&1; then
commits=$(git log "$latest_tag"..HEAD --pretty=format:"%s")
else
commits=$(git log --pretty=format:"%s")
fi
if [ -z "$commits" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"