-
Notifications
You must be signed in to change notification settings - Fork 168
/
Makefile.release
39 lines (30 loc) · 1.73 KB
/
Makefile.release
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
# Goals:
# - Linux releases can be published to Github automatically by Github Actions
#
# This Makefile is meant for machines
include Makefile
# set --pre-release if not tagged or tree is dirty or there's a `-` in the tag
ifneq (,$(findstring -,$(VERSION)))
DOCKERHUB_TAG_PREFIX := "prerelease-"
endif
publish-dockerhub:
docker buildx build \
-t segment/chamber:$(DOCKERHUB_TAG_PREFIX)$(VERSION_MAJOR_MINOR_PATCH) \
-t segment/chamber:$(DOCKERHUB_TAG_PREFIX)$(VERSION_MAJOR_MINOR) \
-t segment/chamber:$(DOCKERHUB_TAG_PREFIX)$(VERSION_MAJOR) \
-t segment/chamber:$(DOCKERHUB_TAG_PREFIX)$(VERSION_NO_V) \
--build-arg VERSION=$(VERSION) \
--platform linux/amd64,linux/arm64 \
--push \
.
dist: dist/chamber-$(VERSION)-darwin-amd64 dist/chamber-$(VERSION)-darwin-arm64 dist/chamber-$(VERSION)-linux-amd64 dist/chamber-$(VERSION)-linux-arm64 dist/chamber-$(VERSION)-windows-amd64.exe dist/chamber_$(VERSION)_amd64.deb dist/chamber_$(VERSION)_amd64.rpm dist/chamber-$(VERSION).sha256sums
dist/chamber-$(VERSION).sha256sums: dist/chamber-$(VERSION)-darwin-amd64 dist/chamber-$(VERSION)-darwin-arm64 dist/chamber-$(VERSION)-linux-amd64 dist/chamber-$(VERSION)-linux-arm64 dist/chamber-$(VERSION)-windows-amd64.exe dist/chamber_$(VERSION)_amd64.deb dist/chamber_$(VERSION)_amd64.rpm
sha256sum $^ | sed 's|dist/||g' > $@
dist/nfpm-$(VERSION).yaml: | dist/
sed -e "s/\$${VERSION}/$(VERSION)/g" -e "s|\$${DIST_BIN}|dist/chamber-$(VERSION)-linux-amd64|g" < nfpm.yaml.tmpl > $@
dist/chamber_$(VERSION)_amd64.deb: dist/nfpm-$(VERSION).yaml dist/chamber-$(VERSION)-linux-amd64
nfpm -f $< pkg --target $@
dist/chamber_$(VERSION)_amd64.rpm: dist/nfpm-$(VERSION).yaml dist/chamber-$(VERSION)-linux-amd64
nfpm -f $< pkg --target $@
.PHONY: \
publish-dockerhub