fix(release): skip tag push when version stamp produced no changes
CI / cargo fmt --check (push) Successful in 35s
CI / cargo clippy (push) Successful in 36s
CI / cargo test (push) Successful in 49s

This commit is contained in:
gffranco
2026-06-24 01:43:28 +00:00
parent 2c835120f8
commit 14301586e0
+8
View File
@@ -103,10 +103,18 @@ jobs:
git config user.email "gitea-actions@users.noreply.code.gfran.co" git config user.email "gitea-actions@users.noreply.code.gfran.co"
git add Cargo.toml Cargo.lock \ git add Cargo.toml Cargo.lock \
crates/nuwiki-lsp/Cargo.toml crates/nuwiki-ls/Cargo.toml crates/nuwiki-lsp/Cargo.toml crates/nuwiki-ls/Cargo.toml
# Check if there are staged changes. If not, the version was already
# correct — create an empty commit just to have a release commit,
# and skip the tag push since it already exists on origin.
if git diff --cached --quiet; then
git commit --allow-empty -m "chore(release): $VER"
echo "No version changes — skipping tag push."
else
git commit -m "chore(release): $VER" git commit -m "chore(release): $VER"
git tag -a "$TAG" -m "nuwiki $VER" git tag -a "$TAG" -m "nuwiki $VER"
git push origin "HEAD:${GITHUB_REF_NAME}" git push origin "HEAD:${GITHUB_REF_NAME}"
git push origin "$TAG" git push origin "$TAG"
fi
build: build:
name: build ${{ matrix.target }} name: build ${{ matrix.target }}