-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (32 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
DOCKER ?= $(shell which docker || which podman)
VERSION = $(shell curl -s 'https://api.github.com/repos/wabarc/wayback/tags?per_page=1' | grep '"name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -e 's/v//g')
TARGET = $(shell echo ${WAYBACK_IPFS_TARGET})
APIKEY = $(shell echo ${WAYBACK_IPFS_APIKEY})
SECRET = $(shell echo ${WAYBACK_IPFS_SECRET})
BUILDER := localhost/wabarc/builder:latest
.PHONY: build
build:
$(DOCKER) build --build-arg WAYBACK_IPFS_TARGET=$(TARGET) --build-arg WAYBACK_IPFS_APIKEY=$(APIKEY) --build-arg WAYBACK_IPFS_SECRET=$(SECRET) -t $(BUILDER) .
$(DOCKER) run --rm -v $(PWD):/aur $(BUILDER)
volume: build
srcinfo:
$(DOCKER) build --build-arg WAYBACK_IPFS_TARGET=$(TARGET) --build-arg WAYBACK_IPFS_APIKEY=$(APIKEY) --build-arg WAYBACK_IPFS_SECRET=$(SECRET) -t $(BUILDER) .
$(DOCKER) run --rm -v $(PWD):/aur $(BUILDER) \
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
version:
$(shell sed -Ei 's/pkgver=[0-9]+\.[0-9]+\.[0-9]+/pkgver=$(VERSION)/g' ./PKGBUILD)
$(shell sed -Ei 's/pkgver = [0-9]+\.[0-9]+\.[0-9]+/pkgver = $(VERSION)/g' ./.SRCINFO)
publish:
$(MAKE) version
git checkout main
git commit -am "Release v$(VERSION)"
git checkout aur
git fetch aur master
git reset --hard aur/master
git checkout main -- .SRCINFO PKGBUILD
git commit -am "Release v$(VERSION)"
git push aur aur:master
git push origin main
clean:
rm -rf src/* pkg/* *.tar.zst
$(DOCKER) rmi $(BUILDER)