-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 2.01 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
39
40
41
42
43
44
45
46
47
UNISON_NEXT_RELEASE=0.5.28
UNISON_CURRENT_RELEASE=0.5.27
UNISON_TRUNK=https://github.com/unisonweb/unison/releases/download/trunk-build/ucm-linux-x64.tar.gz
UNISON_RELEASE:=https://github.com/unisonweb/unison/releases/download/release%2F$(UNISON_CURRENT_RELEASE)/ucm-linux.tar.gz
TRUNK_VERSION := $(UNISON_NEXT_RELEASE)~trunk+$(shell date '+%Y%m%d')
APTLY_URI := $(shell dig +short -t SRV aptly.service.us-west-2.consul.unison-lang.org | awk '{print "http://" $$4 ":" $$3}')
SPACKAGE := $(shell dpkg-parsechangelog -S source)
DIST := bookworm
ARCH := $(shell dpkg --print-architecture)
TRUNK_DEB := ../$(SPACKAGE)_$(TRUNK_VERSION)_$(ARCH).deb
RELEASE_DEB := ../$(SPACKAGE)_$(UNISON_CURRENT_RELEASE)_$(ARCH).deb
CHANGES := ../$(SPACKAGE)_$(UNISON_CURRENT_RELEASE)_$(ARCH).changes
$(CHANGES): debian/*
dpkg-buildpackage -rfakeroot -uc -us
build: $(CHANGES)
v:
@echo $(APTLY_URI)
$(TRUNK_DEB):
wget -O ucm-linux.tar.gz $(UNISON_TRUNK)
dch -b --distribution bookworm -v $(TRUNK_VERSION) "Nightly build"
dpkg-buildpackage -rfakeroot -uc -us
$(RELEASE_DEB):
wget -O ucm-linux.tar.gz $(UNISON_RELEASE)
dch -b --distribution bookworm -v $(UNISON_CURRENT_RELEASE) "Release build"
dpkg-buildpackage -rfakeroot -uc -us
upload-trunk: $(TRUNK_DEB)
curl -X POST -F file=@$(TRUNK_DEB) $(APTLY_URI)/api/files/$(SPACKAGE)
curl -X POST $(APTLY_URI)/api/repos/nightly/file/$(SPACKAGE)
curl -X DELETE $(APTLY_URI)/api/publish//bookworm
curl -X POST -H 'Content-Type: application/json' -d '{"SourceKind":"local", "Sources":[{"Name": "nightly"}, {"Name": "release"}], "Origin":"Unison Computing"}' $(APTLY_URI)/api/publish
upload-release: $(RELEASE_DEB)
curl -X POST -F file=@$(RELEASE_DEB) $(APTLY_URI)/api/files/$(SPACKAGE)
curl -X POST $(APTLY_URI)/api/repos/release/file/$(SPACKAGE)
curl -X DELETE $(APTLY_URI)/api/publish//bookworm
curl -X POST -H 'Content-Type: application/json' -d '{"SourceKind":"local", "Sources":[{"Name": "nightly"}, {"Name": "release"}], "Origin":"Unison Computing"}' $(APTLY_URI)/api/publish
.PHONY: build upload-trunk v