feature test

This commit is contained in:
paltovkone
2026-03-07 20:42:36 +04:00
parent 172e5a3c7e
commit 2fd4a5f9bd

View File

@ -1,6 +1,46 @@
PORTNAME= v2ray
VERSION!= cat VERSION
DISTFILE= v2ray-linux-64.zip
MASTER_SITE= https://github.com/v2fly/v2ray-core/releases/download/v$(VERSION)
PORTNAME=v2ray
VERSION=$(shell cat VERSION)
DISTFILE=v2ray-linux-64.zip
MASTER_SITE=https://github.com/v2fly/v2ray-core/releases/download/v$(VERSION)
DISTDIR=dist
.include "../Makefile"
GITEA_USER?=andrew
GITEA_URL?=https://git.nakolenke.org
GITEA_ORG?=nakolenke-pub
SUITE?=trixie
all: fetch build
fetch:
@echo ">>> Fetching $(DISTFILE)"
@wget -q "$(MASTER_SITE)/$(DISTFILE)" -O /tmp/$(DISTFILE)
@mkdir -p $(DISTDIR)
@unzip -q /tmp/$(DISTFILE) -d $(DISTDIR)/
@chmod +x $(DISTDIR)/$(PORTNAME)
@rm /tmp/$(DISTFILE)
build:
@echo ">>> Building $(PORTNAME)-$(VERSION).deb"
@docker run --rm \
-v $(CURDIR):/work \
-w /work \
-e VERSION=$(VERSION) \
goreleaser/nfpm package \
--config nfpm.yaml \
--target /work \
--packager deb
publish:
@echo ">>> Publishing $(PORTNAME)-$(VERSION)"
@DEB=$$(ls *.deb | head -1) && \
HTTP_CODE=$$(curl -s -o /tmp/resp.txt -w "%{http_code}" \
--user "$(GITEA_USER):$(GITEA_TOKEN)" \
--upload-file "$$DEB" \
"$(GITEA_URL)/api/packages/$(GITEA_ORG)/debian/pool/$(SUITE)/main/upload") && \
cat /tmp/resp.txt && \
[ "$$HTTP_CODE" = "201" ] || exit 1
clean:
@rm -rf $(DISTDIR) *.deb
.PHONY: all fetch build publish clean