@@ -175,9 +175,9 @@ test:
175175.PHONY : dist
176176dist : dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-md.zip dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
177177dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl : check test
178- SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) flit build --setup-py --format wheel
178+ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) python -m flit build --setup-py --format wheel
179179dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz : check test
180- SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) flit build --setup-py --format sdist
180+ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) python -m flit build --setup-py --format sdist
181181dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip : docs-html
182182 python -m zipfile -c dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip docs/_build/html/
183183dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-md.zip : docs-md
@@ -202,6 +202,24 @@ docs/_build/markdown/Home.md: check test
202202 $(MAKE ) -C docs/ markdown
203203 mv docs/_build/markdown/index.md docs/_build/markdown/Home.md
204204
205+ # In rare cases (e.g. when Github goes down) it might be necessary to build and publish
206+ # a package release directly, instead of using the Github Actions workflows. The target
207+ # assumes that all credentials required by `twine` are available through environment
208+ # variables: https://twine.readthedocs.io/en/stable/#environment-variables
209+ emergency-release : emergency-release-pypi
210+ emergency-release-pypi :
211+ if [ " $$ (git branch --show-current)" != " main" ]; then \
212+ echo " Must be on the main branch to release" && exit 1; \
213+ fi
214+ if [ " $$ (git status --porcelain)" != " " ]; then \
215+ echo " Changes detected, please stash or commit them first" && exit 1; \
216+ fi
217+ cz --no-raise 21 bump --changelog --yes
218+ git push
219+ git push --tags
220+ $(MAKE ) dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz
221+ # python -m twine upload --verbose --skip-existing dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-py3-none-any.whl dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
222+
205223# Prune the packages currently installed in the virtual environment down to the required
206224# packages only. Pruning works in a roundabout way, where we first generate the wheels for
207225# all installed packages into the build/wheelhouse/ folder. Next we wipe all packages and
0 commit comments