Merge: - Makefile: repack all release archives so they contain AdGuardHome directory

Squashed commit of the following:

commit f519c82f042670e0bc377ef9f8490edce26085d9
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jul 20 14:41:46 2020 +0300

    fix

commit 890a2c2b7812c2bc69224f88646ff3ab74e1562f
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jul 20 14:24:34 2020 +0300

    fix

commit 753ab74b34a5ef010eb8b1d364f62d5a9c904d28
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jul 20 14:06:49 2020 +0300

    fix

commit 160d0ac83ff656d39597711ab02485c1323f7a0e
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jul 20 13:19:12 2020 +0300

    - Makefile: repack all release archives so they contain AdGuardHome directory
This commit is contained in:
Simon Zolin 2020-07-20 14:55:56 +03:00
parent 4175d82279
commit 87789679f5
1 changed files with 35 additions and 0 deletions

View File

@ -173,6 +173,7 @@ docker-multi-arch:
release: dependencies client release: dependencies client
@echo Starting release build: version $(VERSION), channel $(CHANNEL) @echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND) CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call repack_dist)
$(call write_version_file,$(VERSION)) $(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean PATH=$(GOPATH)/bin:$(PATH) packr clean
@ -232,3 +233,37 @@ define write_version_file
# Finish # Finish
echo "}" >> $(DIST_DIR)/version.json echo "}" >> $(DIST_DIR)/version.json
endef endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Linux
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_amd64.tar.gz && tar czf AdGuardHome_linux_amd64.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_386.tar.gz && tar czf AdGuardHome_linux_386.tar.gz AdGuardHome/ && rm -rf AdGuardHome
# Linux, all kinds of ARM
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_armv5.tar.gz && tar czf AdGuardHome_linux_armv5.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_armv6.tar.gz && tar czf AdGuardHome_linux_armv6.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_armv7.tar.gz && tar czf AdGuardHome_linux_armv7.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_arm64.tar.gz && tar czf AdGuardHome_linux_arm64.tar.gz AdGuardHome/ && rm -rf AdGuardHome
# Linux, MIPS
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_mips_softfloat.tar.gz && tar czf AdGuardHome_linux_mips_softfloat.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_mipsle_softfloat.tar.gz && tar czf AdGuardHome_linux_mipsle_softfloat.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_mips64_softfloat.tar.gz && tar czf AdGuardHome_linux_mips64_softfloat.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_linux_mips64le_softfloat.tar.gz && tar czf AdGuardHome_linux_mips64le_softfloat.tar.gz AdGuardHome/ && rm -rf AdGuardHome
# FreeBSD
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_386.tar.gz && tar czf AdGuardHome_freebsd_386.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_amd64.tar.gz && tar czf AdGuardHome_freebsd_amd64.tar.gz AdGuardHome/ && rm -rf AdGuardHome
# FreeBSD, all kinds of ARM
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_armv5.tar.gz && tar czf AdGuardHome_freebsd_armv5.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_armv6.tar.gz && tar czf AdGuardHome_freebsd_armv6.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_armv7.tar.gz && tar czf AdGuardHome_freebsd_armv7.tar.gz AdGuardHome/ && rm -rf AdGuardHome
cd $(DIST_DIR) && tar xzf AdGuardHome_freebsd_arm64.tar.gz && tar czf AdGuardHome_freebsd_arm64.tar.gz AdGuardHome/ && rm -rf AdGuardHome
endef