project_name: portainer-stack-utils
env:
  - GO111MODULE=on
before:
  hooks:
    - go mod download
builds:
  - main: main.go
    binary: psu
    ldflags:
      - -X github.com/greenled/portainer-stack-utils/version.version={{ .Version }} -X github.com/greenled/portainer-stack-utils/version.commitHash={{ .ShortCommit }} -X github.com/greenled/portainer-stack-utils/version.buildDate={{ .Date }}
    env:
      - CGO_ENABLED=0
    goos:
      - darwin
      - linux
      - windows
    goarch:
      - 386
      - amd64
      - arm
      - arm64
    goarm:
      - 7
archives:
  - format: tar.gz
    format_overrides:
      - goos: windows
        format: zip
    replacements:
      386: 32bit
      amd64: 64bit
      arm: ARM
      arm64: ARM64
      darwin: macOS
      linux: Linux
      windows: Windows
release:
  github:
    owner: greenled
    name: portainer-stack-utils
  prerelease: auto
dockers:
  - image_templates:
      - "{{ .Env.CI_REGISTRY_IMAGE }}:{{ .Major }}"
      - "{{ .Env.CI_REGISTRY_IMAGE }}:{{ .Major }}.{{ .Minor }}"
      - "{{ .Env.CI_REGISTRY_IMAGE }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
    goos: linux
    goarch: amd64
    binaries:
      - psu
    skip_push: auto
    dockerfile: Dockerfile
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: SNAPSHOT