This commit is contained in:
Tiara Rodney 2025-05-25 21:09:56 +02:00
parent a6979d54bd
commit 9632c5a54a
No known key found for this signature in database
GPG key ID: 5F43FAB4FBE5B5EB
9 changed files with 355 additions and 19 deletions

View file

@ -1,4 +1,10 @@
.PHONY: chore configure requirements-dev.txt requirements.txt
BITBUCKET_REPO_SLUG := "sphinxcontrib"
BITBUCKET_WORKSPACE := "byteb4rb1e"
DIST_PATH_PREFIX := "dist/"
TWINE_USERNAME := "__token__"
GPG_SIGNER_FINGERPRINT := "91CD826E74B0174D181903DEF97C70941CD8C4EF"
.PHONY: chore configure requirements-dev.txt requirements.txt publish archive
all: chore
@ -33,6 +39,35 @@ build/doc: docs
dist:
python3 -m pipenv run -v dist
ifdef SIGN
for path in $(DIST_PATH_PREFIX)*.tar.gz $(DIST_PATH_PREFIX)*.whl; do \
echo "$$path"; \
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes "$$path"; \
done
endif
publish: dist
ifndef TWINE_PASSWORD
$(error TWINE_PASSWORD not set)
endif
for path in $(DIST_PATH_PREFIX)*.tar.gz $(DIST_PATH_PREFIX)*.whl; do \
echo "$$path"; \
twine upload $$path $$(test -f "$$path".asc && echo "$$path.asc"); \
done
archive: dist
ifndef BITBUCKET_ACCESS_TOKEN
$(error BITBUCKET_ACCESS_TOKEN not set)
endif
for path in $(DIST_PATH_PREFIX)*; do \
echo "$$path"; \
curl \
--request POST \
--header "Authorization: Bearer $$BITBUCKET_ACCESS_TOKEN" \
--form "files=@$$path;filename=$$(basename "$$path")" \
--fail \
https://api.bitbucket.org/2.0/repositories/$(BITBUCKET_WORKSPACE)/$(BITBUCKET_REPO_SLUG)/downloads; \
done
clean:
rm -rvf autom4te.cache/ config.status config.log configure~ dist/ build/