Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
51773c786e
|
|||
|
b329e7853c
|
23
Makefile
23
Makefile
@@ -48,14 +48,23 @@ endif
|
||||
| python3 -m json.tool || true
|
||||
@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
|
||||
$(error GITEA_TOKEN is not set. Export it first: export GITEA_TOKEN=your_token)
|
||||
endif
|
||||
@echo "Publishing to Gitea Composer registry..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $(GITEA_TOKEN)" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$(GITEA_URL)/api/v1/repos/$(GITEA_OWNER)/$(GITEA_REPO)/tags" \
|
||||
| python3 -m json.tool || true
|
||||
ifndef GITEA_USER
|
||||
$(error GITEA_USER is not set. Export it first: export GITEA_USER=your_username)
|
||||
endif
|
||||
ifndef VERSION
|
||||
$(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 -w "\nHTTP %{http_code}\n" \
|
||||
--user "$(GITEA_USER):$(GITEA_TOKEN)" \
|
||||
--upload-file /tmp/$(GITEA_REPO)-$(SEMVER).zip \
|
||||
"$(GITEA_URL)/api/packages/$(GITEA_OWNER)/composer?version=$(SEMVER)"
|
||||
rm -f /tmp/$(GITEA_REPO)-$(SEMVER).zip
|
||||
@echo "Done. Check: $(GITEA_URL)/$(GITEA_OWNER)/$(GITEA_REPO)/packages"
|
||||
|
||||
Reference in New Issue
Block a user