# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
  hooks:
    - go mod tidy

gitea_urls:
  api: https://codeberg.org/api/v1
  download: https://codeberg.org
  
builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
      - freebsd
    goarch:
      - amd64
      - arm64

archives:
  - formats: [tar.gz]
    # this name template makes the OS and Arch compatible with the results of `uname`.
    name_template: >-
      {{ .ProjectName }}_
      {{- title .Os }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "386" }}i386
      {{- else }}{{ .Arch }}{{ end }}
      {{- if .Arm }}v{{ .Arm }}{{ end }}_{{ .Tag }}
    # use zip for windows archives
    format_overrides:
      - goos: windows
        formats: [zip]
      - goos: linux
        formats: [tar.gz,binary]
    files:
      - src: "*.md"
        strip_parent: true
      - src: Makefile.dist
        dst: Makefile
    wrap_in_directory: true

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"
  groups:
    - title: Improved
      regexp: '^.*?(feat|add|new)(\([[:word:]]+\))??!?:.+$'
      order: 0
    - title: Fixed
      regexp: '^.*?(bug|fix)(\([[:word:]]+\))??!?:.+$'
      order: 1
    - title: Changed
      order: 999

release:
  header: "# Release Notes"
  footer: >-

    ---

    Full Changelog: [{{ .PreviousTag }}...{{ .Tag }}](https://codeberg.org/scip/ephemerup/compare/{{ .PreviousTag }}...{{ .Tag }})
