diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index cf77b88..8a7e6cd 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -103,10 +103,18 @@ jobs: git config user.email "gitea-actions@users.noreply.code.gfran.co" git add Cargo.toml Cargo.lock \ crates/nuwiki-lsp/Cargo.toml crates/nuwiki-ls/Cargo.toml - git commit -m "chore(release): $VER" - git tag -a "$TAG" -m "nuwiki $VER" - git push origin "HEAD:${GITHUB_REF_NAME}" - git push origin "$TAG" + # 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 tag -a "$TAG" -m "nuwiki $VER" + git push origin "HEAD:${GITHUB_REF_NAME}" + git push origin "$TAG" + fi build: name: build ${{ matrix.target }}