Skip to content

Commit

Permalink
Fix build scripts (and static file embed)
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Aug 9, 2020
1 parent 8c56407 commit 0f055ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .goreleaser.yml
Expand Up @@ -9,14 +9,15 @@ before:

builds:
- binary: listmonk
main: ./cmd
goos:
- windows
- darwin
- linux
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.
Expand All @@ -26,8 +27,8 @@ archives:
- format: tar.gz
files:
- README.md
- INSTALL.md
- LICENSE

dockers:
-
goos: linux
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -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.
Expand Down Expand Up @@ -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};)

2 changes: 1 addition & 1 deletion cmd/init.go
Expand Up @@ -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",
}

Expand Down

0 comments on commit 0f055ea

Please sign in to comment.