# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

version: 2

before:
  hooks:
    - cargo install --locked cargo-zigbuild
    - cargo fetch --locked

builds:
  - builder: rust
    dir: .
    command: zigbuild
    flags:
      - --release
      - --package=alef
    targets:
      - x86_64-unknown-linux-gnu
      - aarch64-unknown-linux-gnu
      - aarch64-apple-darwin
      - x86_64-pc-windows-gnu
    binary: alef

archives:
  - formats: [tar.gz]
    name_template: "{{ .ProjectName }}-{{ .Target }}"
    format_overrides:
      - goos: windows
        formats: [zip]

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"
      - "^chore:"

brews:
  - name: alef
    repository:
      owner: kreuzberg-dev
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_TOKEN }}"
    directory: Formula
    homepage: https://github.com/kreuzberg-dev/alef
    description: "Opinionated polyglot binding generator for Rust libraries"
    license: MIT
    install: |
      bin.install "alef"
    test: |
      system "#{bin}/alef", "--help"

release:
  footer: >-

    ---

    Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
