--- # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=jcroql # GoReleaser configuration # Documentation: https://goreleaser.com/customization/ version: 2 # Set the project name project_name: f2b # Clean dist folder before build before: hooks: - go generate ./... # Build configuration builds: # Linux builds with static linking for validated architectures - id: f2b-linux-static main: . binary: f2b # Custom ldflags for optimized builds with static linking ldflags: - -s -w # Strip debug info and symbol table - -X github.com/ivuorinen/f2b/cmd.Version={{.Version}} - -X github.com/ivuorinen/f2b/cmd.commit={{.Commit}} - -X github.com/ivuorinen/f2b/cmd.date={{.Date}} - -X github.com/ivuorinen/f2b/cmd.builtBy=goreleaser - -extldflags=-static # Static linking for validated architectures # Linux platforms validated for static linking goos: - linux goarch: - amd64 # Set environment variables env: - CGO_ENABLED=0 # Custom build tags for optimized static builds tags: - netgo # Pure Go network stack - osusergo # Pure Go user/group lookups # Build flags for optimization flags: - -trimpath # Remove file system paths from binaries # Linux builds without static linking for other architectures - id: f2b-linux-dynamic main: . binary: f2b # Custom ldflags for optimized builds without static linking ldflags: - -s -w # Strip debug info and symbol table - -X github.com/ivuorinen/f2b/cmd.Version={{.Version}} - -X github.com/ivuorinen/f2b/cmd.commit={{.Commit}} - -X github.com/ivuorinen/f2b/cmd.date={{.Date}} - -X github.com/ivuorinen/f2b/cmd.builtBy=goreleaser # Linux platforms that may have issues with static linking goos: - linux goarch: - arm64 - arm - "386" - ppc64le # PowerPC 64-bit LE support - s390x # IBM Z support - mips64 # MIPS 64-bit support - mips64le # MIPS 64-bit LE support goarm: - "6" - "7" # Set environment variables env: - CGO_ENABLED=0 # Custom build tags tags: - netgo # Pure Go network stack - osusergo # Pure Go user/group lookups # Build flags for optimization flags: - -trimpath # Remove file system paths from binaries # Darwin/macOS builds without static linking - id: f2b-darwin main: . binary: f2b # Custom ldflags for optimized builds without static linking ldflags: - -s -w # Strip debug info and symbol table - -X github.com/ivuorinen/f2b/cmd.Version={{.Version}} - -X github.com/ivuorinen/f2b/cmd.commit={{.Commit}} - -X github.com/ivuorinen/f2b/cmd.date={{.Date}} - -X github.com/ivuorinen/f2b/cmd.builtBy=goreleaser # Darwin platforms goos: - darwin goarch: - amd64 - arm64 # Set environment variables env: - CGO_ENABLED=0 # Custom build tags for optimized builds tags: - netgo # Pure Go network stack - osusergo # Pure Go user/group lookups # Build flags for optimization flags: - -trimpath # Remove file system paths from binaries # Windows builds without static linking - id: f2b-windows main: . binary: f2b # Custom ldflags for optimized builds without static linking ldflags: - -s -w # Strip debug info and symbol table - -X github.com/ivuorinen/f2b/cmd.Version={{.Version}} - -X github.com/ivuorinen/f2b/cmd.commit={{.Commit}} - -X github.com/ivuorinen/f2b/cmd.date={{.Date}} - -X github.com/ivuorinen/f2b/cmd.builtBy=goreleaser # Windows platforms goos: - windows goarch: - amd64 - arm64 - "386" # Set environment variables env: - CGO_ENABLED=0 # Custom build tags for optimized builds tags: - netgo # Pure Go network stack - osusergo # Pure Go user/group lookups # Build flags for optimization flags: - -trimpath # Remove file system paths from binaries # BSD builds without static linking - id: f2b-bsd main: . binary: f2b # Custom ldflags for optimized builds without static linking ldflags: - -s -w # Strip debug info and symbol table - -X github.com/ivuorinen/f2b/cmd.Version={{.Version}} - -X github.com/ivuorinen/f2b/cmd.commit={{.Commit}} - -X github.com/ivuorinen/f2b/cmd.date={{.Date}} - -X github.com/ivuorinen/f2b/cmd.builtBy=goreleaser # BSD platforms goos: - freebsd - openbsd - netbsd - dragonfly # Added DragonFly BSD support goarch: - amd64 - arm64 - arm - "386" - ppc64le # Added PowerPC 64-bit LE support - s390x # Added IBM Z support - mips64 # Added MIPS 64-bit support - mips64le # Added MIPS 64-bit LE support goarm: - "6" - "7" # Skip certain combinations for compatibility and practicality ignore: - goos: freebsd goarch: arm # FreeBSD ARM support limited - goos: openbsd goarch: arm # OpenBSD ARM support limited - goos: netbsd goarch: arm # NetBSD ARM support limited - goos: dragonfly goarch: "386" # DragonFly is 64-bit only - goos: dragonfly goarch: arm # DragonFly doesn't support ARM - goos: dragonfly goarch: arm64 # DragonFly doesn't support ARM64 # Set environment variables env: - CGO_ENABLED=0 # Custom build tags for optimized builds tags: - netgo # Pure Go network stack - osusergo # Pure Go user/group lookups # Build flags for optimization flags: - -trimpath # Remove file system paths from binaries # Archive configuration archives: - id: f2b # Support multiple formats formats: ["tar.gz", "tar.xz", "zip"] # Use appropriate formats per platform files: - LICENSE.md - README.md - CHANGELOG.md - docs/* # Optimize compression wrap_in_directory: true # Checksum configuration checksum: name_template: "checksums.txt" algorithm: sha256 # Snapshot configuration snapshot: version_template: "{{ incpatch .Version }}-next" # Release configuration release: github: owner: ivuorinen name: f2b # Release notes header: | ## f2b v{{ .Version }} ({{ .Date }}) A modern, secure Go-based CLI tool for managing Fail2Ban jails and bans. footer: | ## Installation ### Using Go ```bash go install github.com/ivuorinen/f2b@latest ``` ### Using Homebrew (macOS/Linux) ```bash brew tap ivuorinen/tap brew install f2b ``` ### Manual Download Download the appropriate binary for your platform from the assets below. ## Documentation See the [README](https://github.com/ivuorinen/f2b#readme) for usage instructions. # Automatically generate release notes make_latest: true # Changelog configuration changelog: sort: asc use: github filters: exclude: - "^docs:" - "^test:" - "^chore:" - "typo" - "Merge pull request" - "Merge branch" groups: - title: "🚀 Features" regexp: "^feat" - title: "🐛 Bug Fixes" regexp: "^fix" - title: "🔒 Security" regexp: "^security" - title: "⚡ Performance" regexp: "^perf" - title: "♻️ Refactoring" regexp: "^refactor" - title: "Other changes" # Homebrew tap configuration brews: - name: f2b repository: owner: ivuorinen name: homebrew-tap branch: main token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" commit_author: name: goreleaserbot email: bot@goreleaser.com commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" homepage: "https://github.com/ivuorinen/f2b" description: "Modern, secure Go-based CLI tool for managing Fail2Ban jails and bans" license: "MIT" dependencies: - name: go type: optional test: | system "#{bin}/f2b", "version" install: | bin.install "f2b" # NFPM configuration for Linux packages nfpms: - id: f2b package_name: f2b vendor: ivuorinen homepage: https://github.com/ivuorinen/f2b maintainer: ivuorinen description: Modern, secure Go-based CLI tool for managing Fail2Ban jails and bans license: MIT formats: - deb - rpm - apk bindir: /usr/bin contents: - src: ./LICENSE.md dst: /usr/share/doc/f2b/LICENSE.md - src: ./README.md dst: /usr/share/doc/f2b/README.md scripts: postinstall: | #!/bin/sh echo "f2b has been installed. Run 'f2b --help' to get started." # Docker configuration with multi-architecture support dockers: - image_templates: - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-amd64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-amd64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-amd64" - "ghcr.io/ivuorinen/f2b:latest-amd64" dockerfile: | FROM alpine:3.22 RUN apk --no-cache add ca-certificates COPY f2b /usr/local/bin/ ENTRYPOINT ["f2b"] use: buildx goos: linux goarch: amd64 build_flag_templates: - "--pull" # platform inferred from goarch; flag removed for simplicity - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - image_templates: - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-arm64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-arm64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-arm64" - "ghcr.io/ivuorinen/f2b:latest-arm64" dockerfile: | FROM alpine:3.22 RUN apk --no-cache add ca-certificates COPY f2b /usr/local/bin/ ENTRYPOINT ["f2b"] use: buildx goos: linux goarch: arm64 build_flag_templates: - "--pull" # platform inferred from goarch; flag removed for simplicity - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - image_templates: - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-armv7" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-armv7" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-armv7" - "ghcr.io/ivuorinen/f2b:latest-armv7" dockerfile: | FROM alpine:3.22 RUN apk --no-cache add ca-certificates COPY f2b /usr/local/bin/ ENTRYPOINT ["f2b"] use: buildx goos: linux goarch: arm goarm: 7 build_flag_templates: - "--pull" # platform inferred from goarch; flag removed for simplicity - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" # Docker manifest configuration for multi-architecture support docker_manifests: - name_template: "ghcr.io/ivuorinen/f2b:{{ .Tag }}" image_templates: - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-amd64" - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-arm64" - "ghcr.io/ivuorinen/f2b:{{ .Tag }}-armv7" - name_template: "ghcr.io/ivuorinen/f2b:v{{ .Major }}" image_templates: - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-amd64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-arm64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}-armv7" - name_template: "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}" image_templates: - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-amd64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-arm64" - "ghcr.io/ivuorinen/f2b:v{{ .Major }}.{{ .Minor }}-armv7" - name_template: "ghcr.io/ivuorinen/f2b:latest" image_templates: - "ghcr.io/ivuorinen/f2b:latest-amd64" - "ghcr.io/ivuorinen/f2b:latest-arm64" - "ghcr.io/ivuorinen/f2b:latest-armv7" # Announce releases announce: skip: false