# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
  hooks:
    - go mod tidy
    - ./hack/make/completions
    - ./hack/make/manpages

builds:
  - id: darwin_extras_build
    main: ./cmd/ipsw
    binary: ipsw
    env:
      - CGO_ENABLED=1
      - CGO_LDFLAGS=-L/opt/homebrew/lib
      - CGO_CFLAGS=-I/opt/homebrew/include
    goos:
      - darwin
    goarch:
      - amd64
    tags:
      - libusb
      - unicorn
    mod_timestamp: "{{ .CommitTimestamp }}"
    flags:
      - -trimpath
    ldflags: -s -w -X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppVersion={{.Version}} -X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppBuildCommit={{.Commit}}

archives:
  - id : darwin_extras_archive
    builds:
      - darwin_extras_build
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}_extras"
    replacements:
      darwin: macOS
      ios: iOS
      amd64: x86_64
      all: universal
    format_overrides:
      - goos: windows
        format: zip
    files:
      - README.md
      - LICENSE
      - completions/*
      - manpages/*
    wrap_in_directory: true

checksum:
  name_template: "checksums.darwin_extras.txt"

sboms:
  - artifacts: archive