From 76358baa79de171e5c266f4cab85f65e06e69c2a Mon Sep 17 00:00:00 2001 From: "Andrei G." Date: Fri, 20 Feb 2026 17:51:00 +0100 Subject: [PATCH] ci: make release workflow idempotent for re-runs - Switch crates.io publish to katyo/publish-crates@v2 with ignore-unpublished-changes to skip already-published versions - Enable skip-existing for PyPI publish - Handle "already published" error gracefully in npm publish --- .github/workflows/release.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b61576f..b52c8e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,9 +46,11 @@ jobs: uses: rust-lang/crates-io-auth-action@v1 id: auth - name: Publish to crates.io - run: cargo publish -p feedparser-rs - env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + uses: katyo/publish-crates@v2 + with: + path: crates/feedparser-rs-core + registry-token: ${{ steps.auth.outputs.token }} + ignore-unpublished-changes: true # ============================================================================ # PYPI @@ -170,7 +172,7 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist/ - skip-existing: false + skip-existing: true verbose: true # ============================================================================ @@ -265,7 +267,13 @@ jobs: working-directory: crates/feedparser-rs-node run: | echo "npm version: $(npm --version)" - npm publish --access public --ignore-scripts + npm publish --access public --ignore-scripts 2>&1 | tee /tmp/npm-publish.log || { + if grep -q "cannot publish over the previously published versions" /tmp/npm-publish.log; then + echo "Version already published, skipping" + else + exit 1 + fi + } # ============================================================================ # GITHUB RELEASE