chore: update workflows
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
name: Release
|
name: Release
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
name: Version
|
name: Version
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -19,22 +20,29 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
tag=$(git tag -l 'v*' --sort=-v:refname | head -n1)
|
tag=$(git tag -l 'v*' --sort=-v:refname | head -n1)
|
||||||
if [ -z "$tag" ]; then
|
if [ -z "$tag" ]; then
|
||||||
tag="v0.0.0"
|
echo "tag=" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "No existing tags found"
|
||||||
|
else
|
||||||
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Latest tag: $tag"
|
||||||
fi
|
fi
|
||||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "Latest tag: $tag"
|
|
||||||
- name: Determine version bump from commits
|
- name: Determine version bump from commits
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
latest_tag="${{ steps.latest_tag.outputs.tag }}"
|
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}"
|
current="${latest_tag#v}"
|
||||||
IFS='.' read -r major minor patch <<< "$current"
|
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")
|
||||||
commits=$(git log "$latest_tag"..HEAD --pretty=format:"%s")
|
|
||||||
else
|
|
||||||
commits=$(git log --pretty=format:"%s")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$commits" ]; then
|
if [ -z "$commits" ]; then
|
||||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
Reference in New Issue
Block a user