Skip to content
edgesync Artifact [942174e2b2]
Login

Artifact [942174e2b2]

Artifact 942174e2b2446f8465bf7640bb5a16ba8cf182621c2b5858fa17675b45b3ae46:


# GoReleaser config for edgesync.
# https://goreleaser.com
#
# Cross-compiles edgesync and the leaf daemon for macOS and Linux on
# amd64/arm64, archives as tarballs, generates checksums, publishes a
# GitHub release, and updates two Homebrew formulas
# (edgesync, leaf) in danmestas/homebrew-tap.

version: 2

before:
  hooks:
    - go mod tidy
    - sh -c "cd leaf && go mod tidy"

builds:
  - id: edgesync
    main: ./cmd/edgesync
    binary: edgesync
    env:
      - CGO_ENABLED=0
    flags:
      - -trimpath
      - -buildvcs=false
    ldflags:
      - -s -w
      - -X main.version={{.Version}}
      - -X main.commit={{.ShortCommit}}
      - -X main.date={{.CommitDate}}
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64

  # leaf is its own Go module under ./leaf — `dir: leaf` switches goreleaser
  # into that module so its go.mod resolves cleanly without root replaces.
  # The bones CLI spawns this binary and waits for /healthz; shipping it
  # via brew lets `brew install danmestas/tap/bones` pull it as a dep
  # instead of requiring users to clone EdgeSync and `make leaf`.
  - id: leaf
    main: ./cmd/leaf
    dir: leaf
    binary: leaf
    env:
      - CGO_ENABLED=0
    flags:
      - -trimpath
      - -buildvcs=false
    ldflags:
      - -s -w
      - -X main.version={{.Version}}
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64

archives:
  - id: edgesync
    ids: [edgesync]
    formats: [tar.gz]
    name_template: >-
      {{ .ProjectName }}_
      {{- .Version }}_
      {{- .Os }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else }}{{ .Arch }}{{ end }}
    files:
      - LICENSE*
      - README*

  - id: leaf
    ids: [leaf]
    formats: [tar.gz]
    name_template: >-
      leaf_
      {{- .Version }}_
      {{- .Os }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else }}{{ .Arch }}{{ end }}
    files:
      - LICENSE*

checksum:
  name_template: 'checksums.txt'
  algorithm: sha256

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

changelog:
  sort: asc
  use: github
  groups:
    - title: 'Features'
      regexp: '^.*?feat(\(.+\))??!?:.+$'
      order: 0
    - title: 'Bug fixes'
      regexp: '^.*?fix(\(.+\))??!?:.+$'
      order: 1
    - title: 'Other'
      order: 999
  filters:
    exclude:
      - '^docs:'
      - '^chore:'
      - '^test:'
      - '^ci:'
      - 'merge conflict'
      - 'Merge PR'
      - 'Merge pull request'
      - 'Merge remote-tracking branch'
      - 'Merge branch'

release:
  github:
    owner: danmestas
    name: EdgeSync
  draft: false
  prerelease: auto
  name_template: "{{.ProjectName}} v{{.Version}}"
  footer: |
    **Full Changelog**: https://github.com/danmestas/EdgeSync/compare/{{ .PreviousTag }}...{{ .Tag }}

    ## Install

    ### Homebrew (macOS / Linux)
    ```bash
    brew install danmestas/tap/edgesync
    ```

    ### Go
    ```bash
    go install github.com/danmestas/EdgeSync/cmd/edgesync@{{ .Tag }}
    ```

    ### Direct download
    Pick a binary from the assets above for your OS/arch.

brews:
  - name: edgesync
    ids: [edgesync]
    skip_upload: auto
    repository:
      owner: danmestas
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_PAT_TOKEN }}"
    directory: Formula
    homepage: https://github.com/danmestas/EdgeSync
    description: "Sync engine for distributed teams: NATS messaging or peer-to-peer Fossil sync."
    license: Apache-2.0
    install: |
      bin.install "edgesync"
    test: |
      system "#{bin}/edgesync --version"

  # Standalone leaf formula. bones depends on this via `depends_on
  # "danmestas/tap/leaf"` in its own brew formula.
  - name: leaf
    ids: [leaf]
    skip_upload: auto
    repository:
      owner: danmestas
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_PAT_TOKEN }}"
    directory: Formula
    homepage: https://github.com/danmestas/EdgeSync
    description: "Leaf daemon: bridges a workspace to a NATS+Fossil hub. Spawned by bones."
    license: Apache-2.0
    install: |
      bin.install "leaf"
    # leaf has no --version flag; -h prints usage via stdlib flag (exit 0).
    test: |
      assert_match "Usage of", shell_output("#{bin}/leaf -h 2>&1")