# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
  hooks:
    # You may remove this if you don't use go modules.
    - go mod tidy

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
      - windows
      - darwin

archives:
  - format: 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 }}
    # use zip for windows archives
    format_overrides:
      - goos: windows
        format: zip

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"
# .goreleaser.yaml
nfpms:
  # note that this is an array of nfpm configs
  - #
    homepage: https://github.com/carnivuth/lesgofile

    # Your app's maintainer (probably you).
    #
    # Default: inferred from global metadata.
    maintainer: carnivuth <matti200042@gmail.com>

    # Your app's description.
    #
    # Default: inferred from global metadata.
    description: |-
      Share files in local network

    # Formats to be generated.
    formats:
      - apk
      - deb
      - rpm
      - termux.deb
      - archlinux


    # Packages it provides. (overridable)
    provides:
      - lesgofile

    # Path that the binaries should be installed.
    #
    # Default: '/usr/bin'.
    bindir: /usr/bin

    # Section.
    section: default

    # Priority.
    priority: extra

    # Contents to add to the package.
    # GoReleaser will automatically add the binaries.
    contents:
      # Basic file that applies to all packagers
      - src: systemd/lesgofile.service
        dst: /usr/lib/systemd/system/

      # Simple config file
      #- src: etc/lesgofile.json
      #  dst: /etc/lesgofile/lesgofile.json
      #  type: config


    # Scripts to execute during the installation of the package. (overridable)
    #
    # Keys are the possible targets during the installation process
    # Values are the paths to the scripts which will be executed.
    #
    # Templates: allowed.
    scripts:
      preinstall: "scripts/preinstall.sh"
      preremove: "scripts/preremove.sh"
      postremove: "scripts/postremove.sh"
    #
