Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Update local build logic + GitHub actions to the new SSR build.

Kailash Nadhaf5b20aefa9a
diff --git a/.github/workflows/build-sanity.yml b/.github/workflows/build-sanity.yml
index 079b30c7..bd6caf82 100644
--- a/.github/workflows/build-sanity.yml
+++ b/.github/workflows/build-sanity.yml
@@ -4,6 +4,8 @@ on:
pull_request:
types:
- opened
+ - synchronize
+ - reopened
jobs:
build:
@@ -18,5 +20,15 @@ jobs:
with:
go-version: "1.26.1"
+ - name: Set up Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: "1.3.14"
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.x"
+
- name: Prepare Dependencies and Build
run: make dist
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index cf4734da..15409f78 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -57,6 +57,16 @@ jobs:
with:
go-version: "1.26.1"
+ - name: Set up Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: "1.3.14"
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.x"
+
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c2852689..c7a32592 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -24,6 +24,16 @@ jobs:
with:
go-version: "1.26.1"
+ - name: Set up Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: "1.3.14"
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.x"
+
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
diff --git a/.goreleaser-nightly.yml b/.goreleaser-nightly.yml
index 12b12907..39ab6fa2 100644
--- a/.goreleaser-nightly.yml
+++ b/.goreleaser-nightly.yml
@@ -43,7 +43,7 @@ builds:
post: make pack-bin BIN={{ .Path }}
archives:
- - format: tar.gz
+ - formats: [tar.gz]
name_template: "listmonk_nightly_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- README.md
diff --git a/.goreleaser.yml b/.goreleaser.yml
index b10dcf6a..ae741c87 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -1,3 +1,5 @@
+version: 2
+
env:
- GO111MODULE=on
- CGO_ENABLED=0
@@ -36,7 +38,7 @@ builds:
post: make pack-bin BIN={{ .Path }}
archives:
- - format: tar.gz
+ - formats: [tar.gz]
files:
- README.md
- LICENSE
diff --git a/Makefile b/Makefile
index 0c10681c..0300f85b 100644
--- a/Makefile
+++ b/Makefile
@@ -14,14 +14,16 @@ STUFFBIN ?= $(GOPATH)/bin/stuffbin
FRONTEND = static/admin
FRONTEND_DIST = $(FRONTEND)/dist
FRONTEND_NODE_MODULES = $(FRONTEND)/node_modules
+FRONTEND_DEPS_STAMP = $(FRONTEND_NODE_MODULES)/.installed
# Feather icons SVG sprite generated from icons.txt.
FRONTEND_ICONS_LIST = $(FRONTEND)/icons.txt
FRONTEND_ICONS = $(FRONTEND)/assets/static/icons.svg
FRONTEND_DEPS = \
- $(FRONTEND_NODE_MODULES) \
+ $(FRONTEND_DEPS_STAMP) \
$(FRONTEND)/package.json \
+ $(FRONTEND)/bun.lock \
$(FRONTEND)/build.mjs \
$(shell find $(FRONTEND)/assets -type f)
@@ -56,9 +58,9 @@ run: $(FRONTEND_DIST)
CGO_ENABLED=0 go run -ldflags="-s -w -X 'main.buildString=${BUILDSTR}' -X 'main.versionString=${VERSION}'" ./cmd
# Install SSR admin frontend deps.
-$(FRONTEND_NODE_MODULES): $(FRONTEND)/package.json
- cd $(FRONTEND) && bun install
- touch -c $(FRONTEND_NODE_MODULES)
+$(FRONTEND_DEPS_STAMP): $(FRONTEND)/package.json $(FRONTEND)/bun.lock
+ cd $(FRONTEND) && bun install --frozen-lockfile
+ touch $@
# Generate svg icon sprite.
$(FRONTEND_ICONS): $(FRONTEND_ICONS_LIST) scripts/build-icons.py
@@ -80,12 +82,12 @@ build-frontend: $(FRONTEND_DIST)
test:
go test ./...
-# Bundle all static assets including the JS frontends into the ./listmonk binary
-# using stuffbin (installed with make deps).
+# Bundle all static assets including the SSR admin frontend into the ./listmonk binary
+# using stuffbin.
.PHONY: dist
dist: $(STUFFBIN) build build-frontend pack-bin
-# pack-releases runns stuffbin packing on the given binary. This is used
+# pack-bin runs stuffbin packing on the given binary. This is used
# in the .goreleaser post-build hook.
.PHONY: pack-bin
pack-bin: build-frontend $(BIN) $(STUFFBIN)