feature test
This commit is contained in:
34
Makefile
Normal file
34
Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
NFPM= docker run --rm -v $(PWD)/$(PORTNAME):/work -w /work -e VERSION=$(VERSION) goreleaser/nfpm
|
||||
DISTDIR= $(PORTNAME)/dist
|
||||
FETCH= wget -q
|
||||
|
||||
all: fetch build package
|
||||
|
||||
fetch:
|
||||
@echo ">>> Fetching $(DISTFILE)"
|
||||
@$(FETCH) "$(MASTER_SITE)/$(DISTFILE)" -O /tmp/$(DISTFILE)
|
||||
@mkdir -p $(DISTDIR)
|
||||
@unzip -q /tmp/$(DISTFILE) -d $(DISTDIR)/
|
||||
@chmod +x $(DISTDIR)/v2ray
|
||||
@rm /tmp/$(DISTFILE)
|
||||
|
||||
build:
|
||||
@echo ">>> Building $(PORTNAME)-$(VERSION).deb"
|
||||
@$(NFPM) package --config nfpm.yaml --target /work --packager deb
|
||||
|
||||
package: fetch build
|
||||
|
||||
publish:
|
||||
@echo ">>> Publishing $(PORTNAME)-$(VERSION)_amd64.deb"
|
||||
@DEB=$$(ls $(PORTNAME)/*.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 $(PORTNAME)/dist $(PORTNAME)/*.deb
|
||||
|
||||
.PHONY: all fetch build package publish clean
|
||||
Reference in New Issue
Block a user