Browse Source

Fix build scripts (and static file embed)

Kailash Nadh 5 years ago
parent
commit
0f055eacb8
3 changed files with 6 additions and 5 deletions
  1. 3 2
      .goreleaser.yml
  2. 2 2
      Makefile
  3. 1 1
      cmd/init.go

+ 3 - 2
.goreleaser.yml

@@ -9,6 +9,7 @@ before:
 
 
 builds:
 builds:
   - binary: listmonk
   - binary: listmonk
+    main: ./cmd
     goos:
     goos:
       - windows
       - windows
       - darwin
       - darwin
@@ -16,7 +17,7 @@ builds:
     goarch:
     goarch:
       - amd64
       - amd64
     ldflags:
     ldflags:
-      - -s -w -X "main.buildString={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
+      - -s -w -X "main.buildString={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})" -X "main.versionString={{ .Tag }}"
 
 
     hooks:
     hooks:
       # stuff executables with static assets.
       # stuff executables with static assets.
@@ -26,8 +27,8 @@ archives:
   - format: tar.gz
   - format: tar.gz
     files:
     files:
       - README.md
       - README.md
-      - INSTALL.md
       - LICENSE
       - LICENSE
+
 dockers:
 dockers:
   -
   -
     goos: linux
     goos: linux

+ 2 - 2
Makefile

@@ -8,7 +8,7 @@ STATIC := config.toml.sample \
 	schema.sql queries.sql \
 	schema.sql queries.sql \
 	static/public:/public \
 	static/public:/public \
 	static/email-templates \
 	static/email-templates \
-	frontend/dist:/frontend \
+	frontend/dist/favicon.png:/frontend/favicon.png \
 	frontend/dist/frontend:/frontend
 	frontend/dist/frontend:/frontend
 
 
 # Dependencies.
 # Dependencies.
@@ -49,5 +49,5 @@ dist: build build-frontend
 # release builds for cross-build targets.
 # release builds for cross-build targets.
 .PHONY: pack-releases
 .PHONY: pack-releases
 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};)
 
 

+ 1 - 1
cmd/init.go

@@ -126,7 +126,7 @@ func initFS(staticDir string) stuffbin.FileSystem {
 			// The frontend app's static assets are aliased to /frontend
 			// The frontend app's static assets are aliased to /frontend
 			// so that they are accessible at /frontend/js/* etc.
 			// so that they are accessible at /frontend/js/* etc.
 			// Alias all files inside dist/ and dist/frontend to frontend/*.
 			// Alias all files inside dist/ and dist/frontend to frontend/*.
-			"frontend/dist/:/frontend",
+			"frontend/dist/favicon.png:/frontend/favicon.png",
 			"frontend/dist/frontend:/frontend",
 			"frontend/dist/frontend:/frontend",
 		}
 		}