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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
branches: ["main", "claude/**", "feature/**"]
pull_request:
branches: ["main"]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Run tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
continue-on-error: true

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0

- name: golangci-lint
run: golangci-lint run --timeout=5m

build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64
steps:
- uses: actions/checkout@v4

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

- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: go build -ldflags="-s -w" -o /dev/null .
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write
packages: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Build output
mcp-redfish
mcp-redfish.exe
dist/

# Go
*.test
*.out
coverage.txt

# Editor
.vscode/
.idea/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db
30 changes: 30 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "2"

linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- bodyclose
- misspell
- unconvert
- unparam
- noctx

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/conallob/mcp-redfish

issues:
exclude-rules:
- path: "_test\\.go"
linters:
- errcheck
- unparam
111 changes: 111 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
version: 2

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
ldflags:
- -s -w -X main.version={{.Version}}
binary: mcp-redfish

archives:
- formats: [tar.gz]
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
formats: [zip]
files:
- README.md
- LICENSE

checksum:
name_template: checksums.txt

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

dockers:
- image_templates:
- "ghcr.io/conallob/mcp-redfish:{{ .Tag }}-amd64"
- "ghcr.io/conallob/mcp-redfish:latest-amd64"
goarch: amd64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Local MCP server for interacting with server BMCs via the Redfish API"
- "--label=org.opencontainers.image.url=https://github.com/conallob/mcp-redfish"
- "--label=org.opencontainers.image.source=https://github.com/conallob/mcp-redfish"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.licenses=BSD-3-Clause"

- image_templates:
- "ghcr.io/conallob/mcp-redfish:{{ .Tag }}-arm64"
- "ghcr.io/conallob/mcp-redfish:latest-arm64"
goarch: arm64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.description=Local MCP server for interacting with server BMCs via the Redfish API"
- "--label=org.opencontainers.image.url=https://github.com/conallob/mcp-redfish"
- "--label=org.opencontainers.image.source=https://github.com/conallob/mcp-redfish"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.licenses=BSD-3-Clause"

docker_manifests:
- name_template: "ghcr.io/conallob/mcp-redfish:{{ .Tag }}"
image_templates:
- "ghcr.io/conallob/mcp-redfish:{{ .Tag }}-amd64"
- "ghcr.io/conallob/mcp-redfish:{{ .Tag }}-arm64"

- name_template: "ghcr.io/conallob/mcp-redfish:latest"
image_templates:
- "ghcr.io/conallob/mcp-redfish:latest-amd64"
- "ghcr.io/conallob/mcp-redfish:latest-arm64"

brews:
- name: mcp-redfish
repository:
owner: conallob
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
commit_msg_template: "chore: brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/conallob/mcp-redfish"
description: "Local MCP server for interacting with server BMCs via the Redfish API"
license: "BSD-3-Clause"
test: |
system "#{bin}/mcp-redfish", "--version"
install: |
bin.install "mcp-redfish"
extra_install: |
generate_completions_from_executable(bin/"mcp-redfish", "--completions")
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.25-alpine AS builder

WORKDIR /build

# Download dependencies first for layer caching
COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 go build \
-ldflags="-s -w" \
-o mcp-redfish \
.

# Use a minimal runtime image with CA certificates for TLS
FROM alpine:3.21

RUN apk --no-cache add ca-certificates tzdata

COPY --from=builder /build/mcp-redfish /usr/local/bin/mcp-redfish

ENTRYPOINT ["/usr/local/bin/mcp-redfish"]
Loading
Loading