github.com/nats-io/nsc/v2@v2.8.7-0.20240307184528-efd7023c6896/.goreleaser.yml (about)

     1  # Goreleaser configuration for the nats-io/nsc tool.
     2  #
     3  # Note that while we use Goreleaser-Pro for official builds, this file should
     4  # avoid using Pro features if possible, to make it as easy as possible for
     5  # others to reproduce the builds and verify they match.
     6  #
     7  # It is an explicit goal to have reproducible builds.
     8  
     9  project_name: nsc
    10  
    11  release:
    12    github:
    13      owner: nats-io
    14      name: nsc
    15    name_template: '{{.Tag}}'
    16    draft: true
    17  
    18  builds:
    19    - id: nsc
    20      goos:
    21        - darwin
    22        - linux
    23        - windows
    24        - freebsd
    25      goarch:
    26        - amd64
    27        - arm64
    28        - arm
    29        - 386
    30      goarm:
    31        - 6
    32        - 7
    33      ignore:
    34        - goos: windows
    35          goarch: arm64
    36        - goos: windows
    37          goarch: arm
    38        - goos: windows
    39          goarch: 386
    40        - goos: darwin
    41          goarch: 386
    42        - goos: freebsd
    43          goarch: arm
    44        - goos: freebsd
    45          goarch: arm64
    46        - goos: freebsd
    47          goarch: 386
    48      binary: nsc
    49      main: .
    50      env:
    51        - CGO_ENABLED=0
    52      # reproducible builds:
    53      mod_timestamp: "{{ .CommitTimestamp }}"
    54      flags:
    55        - "-trimpath"
    56      # ldflags: Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
    57      # We switch the .Date to .CommitDate per advice at bottom of <https://goreleaser.com/customization/build/> re reproducibility.
    58      ldflags:
    59        - "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}} -X main.builtBy=goreleaser"
    60  
    61  dist: build
    62  
    63  archives:
    64    - id: "nsc.zip"
    65      wrap_in_directory: false
    66      # documented default (2022-04-20):
    67      # '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
    68      name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
    69      format: zip
    70      rlcp: true
    71      files:
    72        - none*
    73  
    74  checksum:
    75    name_template: 'SHA256SUMS-{{ .ProjectName }}.txt'
    76  
    77  snapshot:
    78    name_template: 'dev'
    79  
    80  signs:
    81    - id: cosign
    82      cmd: "./release/sign-cosign"
    83      args: ["${artifact}", "${signature}"]
    84      signature: "${artifact}.cosign.sig"
    85      artifacts: checksum
    86      # We pass COSIGN_PASSWORD from GH secret through env, and cosign(1) picks up
    87      # that automatically, so we don't need to pass the password on stdin.
    88  # Disabled pending Ubuntu 22.04:
    89  # - id: ssh
    90  #   cmd: "./release/sign-ssh"
    91  #   args: ["${artifact}", "${signature}"]
    92  #   signature: "${artifact}.ssh.sig"
    93  #   artifacts: checksum
    94  
    95  
    96  brews:
    97    - name: nsc
    98      folder: Formula
    99      repository:
   100        owner: nats-io
   101        name: homebrew-nats-tools
   102      url_template: 'https://github.com/nats-io/nsc/releases/download/{{ .Tag }}/nsc-{{ .Os }}-{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}.zip'
   103      homepage: "https://github.com/nats-io/nsc"
   104      description: "A tool for creating NATS account and user access configurations"
   105      license: "Apache-2.0"
   106      # Cross-repo upload currently requires that $GITHUB_ACTION be a PAT which has some undesirable security characteristics.
   107      # We are instead registering this as a build artifact, so that the file is available for a manual PR of nsc.rb in the tap.
   108      skip_upload: false
   109      test: |
   110        system "#{bin}/nsc --version"
   111      install: |
   112        bin.install "nsc"
   113