From afa1635d2a10398cfa05dcdf31d90e54510a4973 Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Fri, 8 Sep 2023 11:22:58 +0200
Subject: [PATCH] Add validation checks before attempting to publish on PyPI

* in hopes that publish failures will be less confusing from now on
* also, to detect errors (e.g. missing files in MANIFEST.in) earlier
---
 .gitlab-ci.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9cf3b63..a2c30fa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,9 @@ pypi-release:
   rules:
     - if: '$CI_COMMIT_TAG =~ /^v\d+/'
   script:
-    - pip3 install --upgrade pip build twine
+    - pip3 install --upgrade pip build twine check-manifest
     - rm -f dist/*
+    - python3 -m check_manifest
     - python3 -m build
+    - python3 -m twine check dist/*
     - TWINE_USERNAME=${PYPI_USER} TWINE_PASSWORD=${PYPI_PASSWORD} python3 -m twine upload --skip-existing --non-interactive dist/*
-- 
GitLab