Split tool from content: eec-campaigns becomes a standalone CLI
CI / test (push) Successful in 12s

Campaign content and listmonk credentials now live in separate
per-domain repos that install this tool at a pinned version, so a
client with access to one domain's content repo has no path to
another domain's secrets. Renames the module to the actual Gitea
host path so `go install` works without vanity-import redirects,
drops the four workflows that assumed campaigns/ content lived here,
adds real go-test CI, and rewrites the README for the tool's new
audience.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 20:00:52 -04:00
parent 35142970fb
commit 4006dca9f5
13 changed files with 90 additions and 285 deletions
+21
View File
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- name: Build
run: go build ./...
- name: Test
run: go test ./...
-45
View File
@@ -1,45 +0,0 @@
name: Send campaign
on:
# Pushing a tag like send/big-announcement is the primary trigger — a
# deliberate, git-native, auditable action (git log --tags shows every
# real send that ever happened). These are "command tags," not release
# tags: fine to delete and re-push if a send needs retrying, since the
# actual safety net is listmonk's own draft/paused status check in
# `campaigns send`, not tag uniqueness.
push:
tags: ["send/*"]
# workflow_dispatch is kept alongside it for when clicking a button is
# more convenient than a local `git tag && git push`. Same command either
# way.
workflow_dispatch:
inputs:
slug:
description: "Campaign slug (campaigns/<slug>/) to send"
required: true
type: string
jobs:
send:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- name: Determine campaign slug
id: slug
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "value=${{ inputs.slug }}" >> "$GITHUB_OUTPUT"
else
echo "value=${GITHUB_REF#refs/tags/send/}" >> "$GITHUB_OUTPUT"
fi
- name: Send campaign
run: go run . send "${{ steps.slug.outputs.value }}"
env:
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
-20
View File
@@ -1,20 +0,0 @@
name: Sync default campaign template
on:
workflow_dispatch: {}
jobs:
sync-template:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- name: Sync template to listmonk
run: go run . template "eec-campaigns default" email-templates/campaign.html
env:
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
-22
View File
@@ -1,22 +0,0 @@
name: Sync campaigns
on:
push:
branches: [master]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- name: Sync campaigns to listmonk
run: go run . sync .
env:
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
CAMPAIGNS_PREVIEW_EMAIL: ${{ secrets.CAMPAIGNS_PREVIEW_EMAIL }}
-29
View File
@@ -1,29 +0,0 @@
name: Test-send campaign
on:
workflow_dispatch:
inputs:
slug:
description: "Campaign slug (campaigns/<slug>/) to preview"
required: true
type: string
email:
description: "Address to send the preview to"
required: true
type: string
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- name: Send preview
run: go run . test "${{ inputs.slug }}" "${{ inputs.email }}"
env:
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}