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_REPO := tools/photocli
|
||||
|
||||
.PHONY: all build clean test coverage tag release
|
||||
.PHONY: all build clean test coverage tag release pipeline
|
||||
|
||||
all: build
|
||||
|
||||
@@ -48,17 +48,11 @@ tag:
|
||||
git tag v$(VERSION)
|
||||
git push origin v$(VERSION)
|
||||
|
||||
release: build tag
|
||||
ifndef GITEA_TOKEN
|
||||
$(error GITEA_TOKEN is required. Set it with: export GITEA_TOKEN=your-token)
|
||||
endif
|
||||
curl -sf -X POST "https://$(GITEA_HOST)/api/v1/repos/$(GITEA_REPO)/releases" \
|
||||
-H "Authorization: token $(GITEA_TOKEN)" \
|
||||
-H "Content-Type: application/json" \
|
||||
-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 "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
|
||||
release:
|
||||
tea releases create --repo $(GITEA_REPO) --tag v$(VERSION) --title "v$(VERSION)" --asset $(BINARY)
|
||||
|
||||
pipeline: clean test build
|
||||
@echo "--- verifying version ---"
|
||||
$(BINARY) version
|
||||
@echo "--- all checks passed, ready to release ---"
|
||||
@echo "run: make release"
|
||||
Reference in New Issue
Block a user