github.com/opentofu/opentofu@v1.7.1/.goreleaser.yaml (about)

     1  # Copyright (c) The OpenTofu Authors
     2  # SPDX-License-Identifier: MPL-2.0
     3  # Copyright (c) 2023 HashiCorp, Inc.
     4  # SPDX-License-Identifier: MPL-2.0
     5  
     6  project_name: tofu
     7  
     8  before:
     9    hooks:
    10      - go mod tidy
    11      - go generate ./...
    12      - make protobuf
    13  
    14  builds:
    15    - env:
    16        - CGO_ENABLED=0
    17  
    18      main: ./cmd/tofu
    19  
    20      flags:
    21        - "-mod=readonly"
    22        - "-trimpath"
    23  
    24      ldflags:
    25        - "-s -w"
    26        - "-X 'github.com/opentofu/opentofu/version.dev=no'"
    27  
    28      goos:
    29        - linux
    30        - windows
    31        - darwin
    32        - freebsd
    33        - openbsd
    34        - solaris
    35  
    36      goarch:
    37        - "386"
    38        - amd64
    39        - arm
    40        - arm64
    41  
    42      ignore:
    43        - goos: freebsd
    44          goarch: arm64
    45        - goos: openbsd
    46          goarch: arm
    47        - goos: openbsd
    48          goarch: arm64
    49        - goos: solaris
    50          goarch: "386"
    51        - goos: solaris
    52          goarch: arm
    53        - goos: solaris
    54          goarch: arm64
    55        - goos: windows
    56          goarch: arm
    57        - goos: windows
    58          goarch: arm64
    59        - goos: darwin
    60          goarch: "386"
    61        - goos: darwin
    62          goarch: arm
    63  
    64  archives:
    65    - format: tar.gz
    66      id: targz
    67      name_template: "{{ .ProjectName }}_{{ .Version }}_{{- .Os }}_{{- .Arch }}"
    68    
    69    - format: zip
    70      id: zip 
    71      name_template: "{{ .ProjectName }}_{{ .Version }}_{{- .Os }}_{{- .Arch }}"
    72  
    73  dockers:
    74    - use: buildx
    75      goarch: amd64
    76      build_flag_templates:
    77        - "--pull"
    78        - "--platform=linux/amd64"
    79        - "--label=org.opencontainers.image.title={{ .ProjectName }}"
    80        - "--label=org.opencontainers.image.vendor=OpenTofu"
    81        - "--label=org.opencontainers.image.description=OpenTofu {{ .Version }}"
    82        - "--label=org.opencontainers.image.url=https://github.com/opentofu/opentofu"
    83        - "--label=org.opencontainers.image.documentation=https://github.com/opentofu/opentofu/blob/main/README.md"
    84        - "--label=org.opencontainers.image.source=https://github.com/opentofu/opentofu"
    85        - "--label=org.opencontainers.image.licenses=MPL-2.0"
    86        - "--label=org.opencontainers.image.version={{ .Version }}"
    87        - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
    88        - "--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}"
    89      image_templates:
    90        - "ghcr.io/opentofu/opentofu:{{ .Version }}-amd64"
    91  
    92    - use: buildx
    93      goarch: arm64
    94      build_flag_templates:
    95        - "--pull"
    96        - "--platform=linux/arm64"
    97        - "--label=org.opencontainers.image.title={{ .ProjectName }}"
    98        - "--label=org.opencontainers.image.vendor=OpenTofu"
    99        - "--label=org.opencontainers.image.description=OpenTofu {{ .Version }}"
   100        - "--label=org.opencontainers.image.url=https://github.com/opentofu/opentofu"
   101        - "--label=org.opencontainers.image.documentation=https://github.com/opentofu/opentofu/blob/main/README.md"
   102        - "--label=org.opencontainers.image.source=https://github.com/opentofu/opentofu"
   103        - "--label=org.opencontainers.image.licenses=MPL-2.0"
   104        - "--label=org.opencontainers.image.version={{ .Version }}"
   105        - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
   106        - "--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}"
   107      image_templates:
   108        - "ghcr.io/opentofu/opentofu:{{ .Version }}-arm64"
   109  
   110    - use: buildx
   111      goarch: arm
   112      build_flag_templates:
   113        - "--pull"
   114        - "--platform=linux/arm"
   115        - "--label=org.opencontainers.image.title={{ .ProjectName }}"
   116        - "--label=org.opencontainers.image.vendor=OpenTofu"
   117        - "--label=org.opencontainers.image.description=OpenTofu {{ .Version }}"
   118        - "--label=org.opencontainers.image.url=https://github.com/opentofu/opentofu"
   119        - "--label=org.opencontainers.image.documentation=https://github.com/opentofu/opentofu/blob/main/README.md"
   120        - "--label=org.opencontainers.image.source=https://github.com/opentofu/opentofu"
   121        - "--label=org.opencontainers.image.licenses=MPL-2.0"
   122        - "--label=org.opencontainers.image.version={{ .Version }}"
   123        - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
   124        - "--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}"
   125      image_templates:
   126        - "ghcr.io/opentofu/opentofu:{{ .Version }}-arm"
   127  
   128    - use: buildx
   129      goarch: "386"
   130      build_flag_templates:
   131        - "--pull"
   132        - "--platform=linux/386"
   133        - "--label=org.opencontainers.image.title={{ .ProjectName }}"
   134        - "--label=org.opencontainers.image.vendor=OpenTofu"
   135        - "--label=org.opencontainers.image.description=OpenTofu {{ .Version }}"
   136        - "--label=org.opencontainers.image.url=https://github.com/opentofu/opentofu"
   137        - "--label=org.opencontainers.image.documentation=https://github.com/opentofu/opentofu/blob/main/README.md"
   138        - "--label=org.opencontainers.image.source=https://github.com/opentofu/opentofu"
   139        - "--label=org.opencontainers.image.licenses=MPL-2.0"
   140        - "--label=org.opencontainers.image.version={{ .Version }}"
   141        - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
   142        - "--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}"
   143      image_templates:
   144        - "ghcr.io/opentofu/opentofu:{{ .Version }}-386"
   145  
   146  docker_manifests:
   147    - name_template: ghcr.io/opentofu/opentofu:{{ .Version }}
   148      image_templates:
   149        - ghcr.io/opentofu/opentofu:{{ .Version }}-amd64
   150        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm64
   151        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm
   152        - ghcr.io/opentofu/opentofu:{{ .Version }}-386
   153  
   154    - name_template: ghcr.io/opentofu/opentofu:{{ .Major }}.{{ .Minor }}
   155      image_templates:
   156        - ghcr.io/opentofu/opentofu:{{ .Version }}-amd64
   157        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm64
   158        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm
   159        - ghcr.io/opentofu/opentofu:{{ .Version }}-386
   160      skip_push: auto # Skips the push on pre-release versions, like 1.6.1-alpha1. See https://goreleaser.com/customization/docker_manifest/#customization
   161  
   162    - name_template: ghcr.io/opentofu/opentofu:latest
   163      image_templates:
   164        - ghcr.io/opentofu/opentofu:{{ .Version }}-amd64
   165        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm64
   166        - ghcr.io/opentofu/opentofu:{{ .Version }}-arm
   167        - ghcr.io/opentofu/opentofu:{{ .Version }}-386
   168      skip_push: auto # Skips the push on pre-release versions, like 1.6.1-alpha1. See https://goreleaser.com/customization/docker_manifest/#customization
   169  
   170  nfpms:
   171    - file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}'
   172      maintainer: 'https://github.com/orgs/opentofu/teams/opentofu-core-team'
   173      homepage: https://opentofu.org
   174      description: >-
   175        OpenTofu lets you declaratively manage your cloud infrastructure.
   176      license: "MPL-2.0"
   177      formats:
   178        - deb
   179        - rpm
   180        - apk
   181      bindir: /usr/bin
   182      section: default
   183      contents:
   184        - src: ./LICENSE
   185          dst: /usr/share/doc/opentofu/copyright
   186          file_info:
   187            mode: 0444
   188      rpm:
   189        signature:
   190          key_file: "{{ if index .Env \"GPG_KEY_FILE\"  }}{{.Env.GPG_KEY_FILE}}{{ end }}"
   191      deb:
   192        signature:
   193          key_file: "{{ if index .Env \"GPG_KEY_FILE\"  }}{{.Env.GPG_KEY_FILE}}{{ end }}"
   194  
   195  snapcrafts:
   196    - name: opentofu
   197      publish: true
   198      summary: OpenTofu lets you declaratively manage your cloud infrastructure.
   199      description: |
   200        OpenTofu is an OSS tool for building, changing, and versioning infrastructure
   201        safely and efficiently. OpenTofu can manage existing and popular service
   202        providers as well as custom in-house solutions.
   203      disable: '{{ if eq .Env.RELEASE_FLAG_LATEST "false" }}true{{ else }}false{{ end }}'
   204      channel_templates:
   205        - '{{ if eq .Env.RELEASE_FLAG_PRERELEASE "true" }}latest/edge{{ else }}latest/stable{{ end }}'
   206      grade: '{{ if eq .Env.RELEASE_FLAG_PRERELEASE "true" }}devel{{ else }}stable{{ end }}'
   207      confinement: classic
   208      license: MPL-2.0
   209      base: core22
   210      apps:
   211        tofu:
   212          command: tofu
   213          aliases: [tofu]
   214  
   215  checksum:
   216    name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
   217  
   218  signs:
   219    - artifacts: all
   220      id: cosign
   221      cmd: cosign
   222      certificate: "${artifact}.pem"
   223      args: [ "sign-blob", "--oidc-issuer=https://token.actions.githubusercontent.com", "--output-certificate=${certificate}", "--output-signature=${signature}", "${artifact}", "--yes" ]
   224    - artifacts: all
   225      signature: "${artifact}.gpgsig"
   226      id: gpg
   227      cmd: gpg
   228      args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}" ]
   229  
   230  docker_signs:
   231    - artifacts: all
   232      args: [ "sign", "--oidc-issuer=https://token.actions.githubusercontent.com", "${artifact}@${digest}", "--yes" ]
   233  
   234  snapshot:
   235    name_template: "{{ .Version }}-next"
   236  
   237  changelog:
   238    use: github-native
   239  
   240  release:
   241    prerelease: auto
   242    draft: true