github.com/grafana/pyroscope@v1.18.0/.goreleaser.yaml (about)

     1  project_name: pyroscope
     2  version: 2
     3  before:
     4    hooks:
     5      # This hook ensures that goreleaser uses the correct go version for a Pyroscope release
     6      - sh -euc 'go version | grep "go version go1.24.12 " || { echo "Unexpected go version"; exit 1; }'
     7  env:
     8    # Strip debug information from the binary by default, weekly builds will have debug information
     9    - GORELEASER_DEBUG_INFO_FLAGS={{ if and (index .Env "GORELEASER_STRIP_DEBUG_INFO") (eq .Env.GORELEASER_STRIP_DEBUG_INFO "false")  }}{{ else }}-s -w{{ end }}
    10    # Use a custom image prefix (registry) or fallback to docker.io/grafana/
    11    - IMAGE_PREFIX={{ or (index .Env "IMAGE_PREFIX") "docker.io/grafana/" }}
    12    # Allow a custom image tag to be used (must be set by workflow)
    13    - IMAGE_TAG={{ .Env.IMAGE_TAG }}
    14    # Publish latest image tag
    15    - IMAGE_PUBLISH_LATEST={{ or (index .Env "IMAGE_PUBLISH_LATEST") "false" }}
    16    # Skip GitHub release upload
    17    - GITHUB_RELEASE_DISABLE={{ or (index .Env "GITHUB_RELEASE_DISABLE") "false" }}
    18    # Skip builds of non linux oses
    19    - GORELEASER_LINUX_ONLY={{ or (index .Env "GORELEASER_LINUX_ONLY") "false" }}
    20  builds:
    21    - env:
    22        - CGO_ENABLED=0
    23      goos:
    24        - linux
    25      goarch:
    26        - amd64
    27        - arm64
    28      goamd64:
    29        - v2
    30      main: ./cmd/pyroscope
    31      mod_timestamp: "{{ .CommitTimestamp }}"
    32      flags:
    33        - -trimpath
    34      tags:
    35        - netgo
    36        - embedassets
    37      ldflags:
    38        - >
    39          -extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
    40          -X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
    41          -X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
    42          -X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
    43          -X "github.com/grafana/pyroscope/pkg/util/build.BuildDate={{ .CommitDate }}"
    44      id: pyroscope
    45    - env:
    46        - CGO_ENABLED=0
    47      goos:
    48        - darwin
    49      goarch:
    50        - amd64
    51        - arm64
    52      goamd64:
    53        - v2
    54      main: ./cmd/pyroscope
    55      mod_timestamp: "{{ .CommitTimestamp }}"
    56      flags:
    57        - -trimpath
    58      tags:
    59        - netgo
    60        - embedassets
    61      ldflags:
    62        - >
    63          -extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
    64          -X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
    65          -X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
    66          -X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
    67          -X "github.com/grafana/pyroscope/pkg/util/build.BuildDate={{ .CommitDate }}"
    68      id: pyroscope_non_linux
    69      skip: '{{ if eq .Env.GORELEASER_LINUX_ONLY "true" }}true{{ else }}false{{ end }}'
    70    - env:
    71        - CGO_ENABLED=0
    72      tags:
    73        - netgo
    74      ldflags:
    75        - >
    76          -extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
    77          -X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
    78          -X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
    79          -X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
    80          -X "github.com/grafana/pyroscope/pkg/util/build.BuildDate={{ .CommitDate }}"
    81      goos:
    82        - linux
    83      goarch:
    84        - amd64
    85        - arm64
    86      goamd64:
    87        - v2
    88      ignore:
    89        - goos: windows
    90          goarch: arm
    91      main: ./cmd/profilecli
    92      mod_timestamp: "{{ .CommitTimestamp }}"
    93      flags:
    94        - -trimpath
    95      binary: profilecli
    96      id: profilecli
    97    - env:
    98        - CGO_ENABLED=0
    99      tags:
   100        - netgo
   101      ldflags:
   102        - >
   103          -extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
   104          -X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
   105          -X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
   106          -X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
   107          -X "github.com/grafana/pyroscope/pkg/util/build.BuildDate={{ .CommitDate }}"
   108      goos:
   109        - windows
   110        - darwin
   111      goarch:
   112        - amd64
   113        - arm64
   114      goamd64:
   115        - v2
   116      ignore:
   117        - goos: windows
   118          goarch: arm
   119      main: ./cmd/profilecli
   120      mod_timestamp: "{{ .CommitTimestamp }}"
   121      flags:
   122        - -trimpath
   123      binary: profilecli
   124      id: profilecli_non_linux
   125      skip: '{{ if eq .Env.GORELEASER_LINUX_ONLY "true" }}true{{ else }}false{{ end }}'
   126  dockers:
   127    - use: buildx
   128      goos: linux
   129      goarch: amd64
   130      goamd64: v2
   131      dockerfile: ./cmd/pyroscope/Dockerfile
   132      ids:
   133        - pyroscope
   134        - profilecli
   135      extra_files:
   136        - cmd/pyroscope/pyroscope.yaml
   137      image_templates:
   138        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
   139      build_flag_templates:
   140        - "--platform=linux/amd64"
   141        - "--label=org.opencontainers.image.created={{.Date}}"
   142        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   143        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   144        - "--label=org.opencontainers.image.version={{.Version}}"
   145    - use: buildx
   146      goos: linux
   147      goarch: arm64
   148      dockerfile: ./cmd/pyroscope/Dockerfile
   149      ids:
   150        - pyroscope
   151        - profilecli
   152      extra_files:
   153        - cmd/pyroscope/pyroscope.yaml
   154      image_templates:
   155        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
   156      build_flag_templates:
   157        - "--platform=linux/arm64/v8"
   158        - "--label=org.opencontainers.image.created={{.Date}}"
   159        - "--label=org.opencontainers.image.title={{.ProjectName}}"
   160        - "--label=org.opencontainers.image.revision={{.FullCommit}}"
   161        - "--label=org.opencontainers.image.version={{.Version}}"
   162  docker_manifests:
   163    # https://goreleaser.com/customization/docker_manifest/
   164    - name_template: "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}"
   165      image_templates:
   166        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
   167        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
   168    - name_template: "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:latest"
   169      image_templates:
   170        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
   171        - "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
   172      skip_push: '{{ if eq .Env.IMAGE_PUBLISH_LATEST "true" }}false{{ else }}true{{ end }}'
   173  nfpms:
   174    - id: pyroscope
   175      formats:
   176        - deb
   177        - rpm
   178      section: default
   179      maintainer: Grafana Labs <support@grafana.com>
   180      vendor: Grafana Labs Inc
   181      homepage: https://grafana.com/pyroscope
   182      license: AGPL-3.0
   183      file_name_template: '{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
   184      contents:
   185        - src: ./tools/packaging/pyroscope.service
   186          dst: /etc/systemd/system/pyroscope.service
   187        - src: ./cmd/pyroscope/pyroscope.yaml
   188          dst: /etc/pyroscope/config.yml
   189          type: config|noreplace
   190      scripts:
   191        postinstall: ./tools/packaging/postinstall.sh
   192  
   193  archives:
   194    - id: pyroscope
   195      name_template: '{{.ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
   196      ids:
   197        - pyroscope
   198        - pyroscope_non_linux
   199    - id: profilecli
   200      name_template: 'profilecli_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
   201      ids:
   202        - profilecli
   203        - profilecli_non_linux
   204      format_overrides:
   205        - goos: windows
   206          formats: [zip]
   207  checksum:
   208    name_template: "checksums.txt"
   209  snapshot:
   210    version_template: "{{ incpatch .Version }}-next"
   211  changelog:
   212    sort: asc
   213    filters:
   214      exclude:
   215        - "^test:"
   216  release:
   217    # Draft releases break our Homebrew release which
   218    # depends on asset urls created on release "publish"
   219    draft: false
   220    make_latest: '{{ .Env.IMAGE_PUBLISH_LATEST }}'
   221    footer: |
   222      As always, feedback is more than welcome, feel free to open issues/discussions.
   223      You can reach out to the team using:
   224  
   225      - [Slack](https://grafana.slack.com/archives/C049PLMV8TB)
   226      - [Github Discussions](https://github.com/grafana/pyroscope/discussions)
   227      - [Github Issues](https://github.com/grafana/pyroscope/issues)
   228      - [Mailing List](https://groups.google.com/g/pyroscope-team)
   229  
   230      ## Docker Images
   231  
   232      - [grafana/pyroscope](https://hub.docker.com/r/grafana/pyroscope/tags)
   233  
   234      ```bash
   235        docker pull {{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}
   236      ```
   237  
   238    ids:
   239      - pyroscope
   240      - profilecli
   241    disable: '{{ .Env.GITHUB_RELEASE_DISABLE }}'
   242  # milestones:
   243  #   - close: true
   244  
   245  # modelines, feel free to remove those if you don't want/use them:
   246  # yaml-language-server: $schema=https://goreleaser.com/static/schema.json
   247  # vim: set ts=2 sw=2 tw=0 fo=cnqoj