diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b08dfac..4bf6cc7 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -64,6 +64,7 @@ jobs: - name: Extract version from Cargo.toml id: get_version + shell: bash run: | VERSION=$(grep -E '^version\s*=' Cargo.toml | head -n1 | sed 's/.*"\(.*\)".*/\1/') echo "version=${VERSION}" >> $GITHUB_OUTPUT @@ -170,6 +171,7 @@ jobs: - name: Extract version from Cargo.toml id: get_version + shell: bash run: | VERSION=$(grep -E '^version\s*=' Cargo.toml | head -n1 | sed 's/.*"\(.*\)".*/\1/') echo "version=${VERSION}" >> $GITHUB_OUTPUT @@ -181,6 +183,14 @@ jobs: run: | cd ./artifacts TAG="v${VERSION}" + + # Check if release already exists and delete it (it was created without artifacts) + if gh release view "${TAG}" &>/dev/null; then + echo "Release ${TAG} already exists, deleting it to recreate with artifacts..." + gh release delete "${TAG}" --yes + fi + + # Create the release with all artifacts gh release create "${TAG}" \ --title "Release ${TAG}" \ --generate-notes \