Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ permissions:
packages: write

jobs:
# Downloadable binaries, for running the agent as a host process (systemd, launchd)
# rather than as a container. Linux and macOS only — the agent reaches Docker over a
# unix socket or TCP, and Windows serves its daemon on a named pipe, so a Windows
# build would run and then never find Docker.
binaries:
runs-on: ubuntu-latest
permissions:
contents: write # create the GitHub release and upload the archives
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # full history so the changelog can diff against prior tags

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/miabi-agent
/agent
*.exe

# GoReleaser build output
/dist/
91 changes: 91 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# GoReleaser config for the Miabi node agent.
#
# The container image stays the primary way to run the agent (see Dockerfile and
# install-agent.sh) — it is what the cluster-wide global service ships to every swarm
# worker. These binaries are for the other case: running the agent as a host process
# under systemd/launchd, on a node where you would rather not add a container to
# supervise the containers.
#
# Release: goreleaser release --clean (on a tag)
# Snapshot: goreleaser build --snapshot --clean
version: 2

project_name: miabi-agent

before:
hooks:
- go mod tidy

builds:
- id: miabi-agent
main: .
binary: miabi-agent
env:
- CGO_ENABLED=0
flags:
- -trimpath
# Linux and macOS only, and Windows is a deliberate omission rather than an
# oversight: the agent reaches Docker over `unix://` or `tcp://` (see dialDocker),
# and Windows serves its daemon on a named pipe (npipe://). A Windows binary would
# build cleanly and then fail to find Docker on every machine it ran on, which is
# worse than not shipping one.
goos: [linux, darwin]
goarch: [amd64, arm64]
ldflags:
- -s -w
- -X main.version={{ .Version }}
mod_timestamp: "{{ .CommitTimestamp }}"

archives:
- id: miabi-agent
ids: [miabi-agent]
name_template: "miabi-agent_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
formats: [tar.gz]
files:
- LICENSE
- README.md

checksum:
name_template: "checksums.txt"

snapshot:
version_template: "{{ incpatch .Version }}-dev"

changelog:
use: github
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
- "^ci:"
- "Merge pull request"
- "Merge branch"

release:
github:
owner: miabi-io
name: agent
prerelease: auto
name_template: "Miabi Agent {{ .Tag }}"
footer: |
---

## Container image

The agent is normally run as a container — that is what the installer and the
cluster-wide agent service use:

docker run -d --name miabi-agent --restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-e MIABI_CONTROL_URL=https://miabi.example.com \
-e MIABI_NODE_TOKEN=mbn_xxxxxxxx \
miabi/agent:{{ .Version }}

Images are published to Docker Hub (`miabi/agent`) and GHCR
(`ghcr.io/miabi-io/agent`), tagged `latest` and `{{ .Version }}`.

The binaries above are for running the agent directly on a host (systemd, launchd)
instead of in a container. They need the same two settings, plus a reachable Docker
socket — and, behind a private CA, `MIABI_CA_CERT`.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/miabi-io/miabi-agent
go 1.25.0

require (
github.com/gorilla/websocket v1.5.3 // indirect
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/yamux v0.1.2
)

Expand Down