diff --git a/Makefile b/Makefile index d6c68e7..bdc9cbe 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,9 @@ SPEC = dch-selinux.spec RPM = dch-selinux-$(VERSION)-$(RELEASE).$(ARCH).rpm SRPM = dch-selinux-$(VERSION)-$(RELEASE).src.rpm +GITEA_URL = https://git.pyrocufflink.net +GITEA_ORG = infra + define buildpp $(MAKE) NAME=$(NAME) -f /usr/share/selinux/devel/Makefile endef @@ -65,16 +68,14 @@ endif mock -r '$(MOCKTARGET)' $(SRPM) cp -a /var/lib/mock/$(MOCKTARGET)/result/*.noarch.rpm . -publish: repo -ifeq ($(PUBLISH_HOST),) - $(error PUBLISH_HOST and PUBLISH_PATH are required) +publish: $(RPM) +ifeq ($(GITEA_USERNAME),) + $(error GITEA_USERNAME and GITEA_PASSWORD are required) endif - rsync -rtiO --delete $(REPO)/ $(PUBLISH_HOST):$(PUBLISH_PATH) - -repo: - mkdir -p '$(REPO)' - cp *.rpm '$(REPO)'/ - createrepo '$(REPO)' + curl -f \ + '$(GITEA_URL)/api/packages/$(GITEA_ORG)/rpm/upload' \ + -u '$(GITEA_USERNAME):$(GITEA_PASSWORD)' \ + -T $< rpm: $(RPM)