From fd609835168fefa765628a175bd12e9908ecebb7 Mon Sep 17 00:00:00 2001
From: Wilson Lin <code@wilsonl.in>
Date: Fri, 17 Jun 2022 18:01:13 +1000
Subject: [PATCH] Handle existing wheels when building Python library

---
 .github/workflows/python.yml | 3 ++-
 CHANGELOG.md                 | 4 ++++
 README.md                    | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 25ce77b2..0bce247e 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -106,7 +106,8 @@ jobs:
           # On macOS ARM64 this may emit a warning like "Couldn't find the symbol `PyInit_minify_html_core` in the native library. Python will fail to import this module." Ignore this message.
           maturin build --release --strip -i "$pathToPython"
           if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
-            twine upload target/wheels/*
+            # For idempotency, ignore any existing built wheels that have already been successfully uploaded.
+            twine upload --skip-existing target/wheels/*
           else
             ls -al target/wheels/*
           fi
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77691583..93b29ddb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # minify-html changelog
 
+## 0.8.2
+
+- Fix Python build pipeline to handle existing uploaded wheels from previous successful build attempts.
+
 ## 0.8.1
 
 - Create wrapper index.js for Node.js library to support ESM.
diff --git a/README.md b/README.md
index 299ed6e0..5987d24d 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ A Rust HTML minifier meticulously optimised for speed and effectiveness, with bi
 
 ## Performance
 
-Comparison with [html-minfier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize), run on the top web pages. [See the breakdown here.](./bench)
+Comparison with [html-minifier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize), run on the top web pages. [See the breakdown here.](./bench)
 
 <img width="400" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.8.1/core/average-speeds.png"><img width="400" alt="Chart showing compression of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.8.1/core/average-sizes.png">