EC-21: FIX: Gitea Tages not needed for packages

This commit is contained in:
2026-02-20 11:52:02 +00:00
parent caadc5545d
commit e6d9b64020

View File

@@ -48,14 +48,24 @@ endif
| python3 -m json.tool || true | python3 -m json.tool || true
@echo "Packagist notified." @echo "Packagist notified."
gitea-publish: ## Publish current tagged version to Gitea Composer registry (requires GITEA_TOKEN env var) gitea-publish: ## Zip and PUT package to Gitea Composer registry (requires GITEA_TOKEN, GITEA_USER, VERSION)
ifndef GITEA_TOKEN ifndef GITEA_TOKEN
$(error GITEA_TOKEN is not set. Export it first: export GITEA_TOKEN=your_token) $(error GITEA_TOKEN is not set. Export it first: export GITEA_TOKEN=your_token)
endif endif
@echo "Publishing to Gitea Composer registry..." ifndef GITEA_USER
curl -s -X POST \ $(error GITEA_USER is not set. Export it first: export GITEA_USER=your_username)
-H "Authorization: token $(GITEA_TOKEN)" \ endif
-H "Content-Type: application/json" \ ifndef VERSION
"$(GITEA_URL)/api/v1/repos/$(GITEA_OWNER)/$(GITEA_REPO)/tags" \ $(error VERSION is not set. Usage: make gitea-publish VERSION=v0.1.0)
endif
$(eval SEMVER := $(shell echo $(VERSION) | sed 's/^v//'))
@echo "Creating zip from git archive..."
git archive --format=zip HEAD > /tmp/$(GITEA_REPO)-$(SEMVER).zip
@echo "Publishing $(SEMVER) to Gitea Composer registry..."
curl -s \
--user "$(GITEA_USER):$(GITEA_TOKEN)" \
--upload-file /tmp/$(GITEA_REPO)-$(SEMVER).zip \
"$(GITEA_URL)/api/packages/$(GITEA_OWNER)/composer?version=$(SEMVER)" \
| python3 -m json.tool || true | python3 -m json.tool || true
rm -f /tmp/$(GITEA_REPO)-$(SEMVER).zip
@echo "Done. Check: $(GITEA_URL)/$(GITEA_OWNER)/$(GITEA_REPO)/packages" @echo "Done. Check: $(GITEA_URL)/$(GITEA_OWNER)/$(GITEA_REPO)/packages"