feat(self-update): resolve latest via Forgejo/gitea releases API

This commit is contained in:
kj
2026-10-05 15:50:13 -03:00
parent 0220e97109
commit 7025ccf553
7 changed files with 316 additions and 9 deletions
+25
View File
@@ -0,0 +1,25 @@
# duckbrain-toolbox: atajos del ciclo de desarrollo y publicacion del phar.
# `publish` requiere FORGEJO_TOKEN en el entorno (token de la API con write:repository).
CONFIG := packages/commands/src/Toolbox/Config.php
VERSION := $(shell grep -oP "const VERSION = '\K[^']+" $(CONFIG))
.PHONY: help test build publish check clean
help: ## Muestra esta ayuda
@grep -hE '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | sed -E 's/^([a-z-]+):.*## (.+)$$/ make \1 \xe2\x80\x94 \2/'
test: ## Corre la suite de pruebas (harness propio, sin phpunit)
php tests/run.php
build: ## Construye dist/duckbrain.phar y su .sha256
scripts/build-phar
publish: build ## Crea/mueve la release v$(VERSION) en Forgejo y sube los assets
scripts/publish-phar
check: ## Pregunta al servidor si hay un instalador mas nuevo (exit 1 si la hay)
php bin/duckbrain self-update --check
clean: ## Borra dist/
rm -rf dist