From 0f055eacb87030b55970f4870ff3a0b22b0dcaef Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 9 Aug 2020 20:02:43 +0530 Subject: [PATCH] Fix build scripts (and static file embed) --- .goreleaser.yml | 5 +++-- Makefile | 4 ++-- cmd/init.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index ff6b179..55d3bc0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,6 +9,7 @@ before: builds: - binary: listmonk + main: ./cmd goos: - windows - darwin @@ -16,7 +17,7 @@ builds: goarch: - amd64 ldflags: - - -s -w -X "main.buildString={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})" + - -s -w -X "main.buildString={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})" -X "main.versionString={{ .Tag }}" hooks: # stuff executables with static assets. @@ -26,8 +27,8 @@ archives: - format: tar.gz files: - README.md - - INSTALL.md - LICENSE + dockers: - goos: linux diff --git a/Makefile b/Makefile index 032ca75..c5dd205 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ STATIC := config.toml.sample \ schema.sql queries.sql \ static/public:/public \ static/email-templates \ - frontend/dist:/frontend \ + frontend/dist/favicon.png:/frontend/favicon.png \ frontend/dist/frontend:/frontend # Dependencies. @@ -49,5 +49,5 @@ dist: build build-frontend # release builds for cross-build targets. .PHONY: pack-releases pack-releases: - $(foreach var,$(RELEASE_BUILDS),stuffbin -a stuff -in ${var} -out ${var} ${STATIC} $(var);) + $(foreach var,$(RELEASE_BUILDS),stuffbin -a stuff -in ${var} -out ${var} ${STATIC};) diff --git a/cmd/init.go b/cmd/init.go index 651a3a2..ca358c0 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -126,7 +126,7 @@ func initFS(staticDir string) stuffbin.FileSystem { // The frontend app's static assets are aliased to /frontend // so that they are accessible at /frontend/js/* etc. // Alias all files inside dist/ and dist/frontend to frontend/*. - "frontend/dist/:/frontend", + "frontend/dist/favicon.png:/frontend/favicon.png", "frontend/dist/frontend:/frontend", }