add pipeline and tea release targets
This commit is contained in:
@@ -10,7 +10,7 @@ STUB_LIB := $(BRIDGE_DIR)/libphotokit_bridge_stub.a
|
|||||||
GITEA_HOST := gitea-1.tail82444.ts.net
|
GITEA_HOST := gitea-1.tail82444.ts.net
|
||||||
GITEA_REPO := tools/photocli
|
GITEA_REPO := tools/photocli
|
||||||
|
|
||||||
.PHONY: all build clean test coverage tag release
|
.PHONY: all build clean test coverage tag release pipeline
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
@@ -48,17 +48,11 @@ tag:
|
|||||||
git tag v$(VERSION)
|
git tag v$(VERSION)
|
||||||
git push origin v$(VERSION)
|
git push origin v$(VERSION)
|
||||||
|
|
||||||
release: build tag
|
release:
|
||||||
ifndef GITEA_TOKEN
|
tea releases create --repo $(GITEA_REPO) --tag v$(VERSION) --title "v$(VERSION)" --asset $(BINARY)
|
||||||
$(error GITEA_TOKEN is required. Set it with: export GITEA_TOKEN=your-token)
|
|
||||||
endif
|
pipeline: clean test build
|
||||||
curl -sf -X POST "https://$(GITEA_HOST)/api/v1/repos/$(GITEA_REPO)/releases" \
|
@echo "--- verifying version ---"
|
||||||
-H "Authorization: token $(GITEA_TOKEN)" \
|
$(BINARY) version
|
||||||
-H "Content-Type: application/json" \
|
@echo "--- all checks passed, ready to release ---"
|
||||||
-d '{"tag_name":"v$(VERSION)","name":"v$(VERSION)","body":"photoscli v$(VERSION)"}' | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['id'])" > /tmp/_photoscli_release_id
|
@echo "run: make release"
|
||||||
@echo "created release v$(VERSION)"
|
|
||||||
curl -sf -X POST "https://$(GITEA_HOST)/api/v1/repos/$(GITEA_REPO)/releases/$$(cat /tmp/_photoscli_release_id)/assets?name=photoscli" \
|
|
||||||
-H "Authorization: token $(GITEA_TOKEN)" \
|
|
||||||
-F "attachment=@$(BINARY)"
|
|
||||||
@echo "uploaded $(BINARY) to release v$(VERSION)"
|
|
||||||
@rm -f /tmp/_photoscli_release_id
|
|
||||||
Reference in New Issue
Block a user