github.com/nats-io/nsc@v0.0.0-20221206222106-35db9400b257/.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: ./main.go 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 files: 71 - none* 72 73 checksum: 74 name_template: 'SHA256SUMS-{{ .ProjectName }}.txt' 75 76 snapshot: 77 name_template: 'dev' 78 79 signs: 80 - id: cosign 81 cmd: "./release/sign-cosign" 82 args: ["${artifact}", "${signature}"] 83 signature: "${artifact}.cosign.sig" 84 artifacts: checksum 85 # We pass COSIGN_PASSWORD from GH secret through env, and cosign(1) picks up 86 # that automatically, so we don't need to pass the password on stdin. 87 # Disabled pending Ubuntu 22.04: 88 # - id: ssh 89 # cmd: "./release/sign-ssh" 90 # args: ["${artifact}", "${signature}"] 91 # signature: "${artifact}.ssh.sig" 92 # artifacts: checksum 93 94 95 brews: 96 - name: nsc 97 folder: Formula 98 tap: 99 owner: nats-io 100 name: homebrew-nats-tools 101 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' 102 homepage: "https://github.com/nats-io/nsc" 103 description: "A tool for creating NATS account and user access configurations" 104 license: "Apache-2.0" 105 # Cross-repo upload currently requires that $GITHUB_ACTION be a PAT which has some undesirable security characteristics. 106 # 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. 107 skip_upload: true 108 test: | 109 system "#{bin}/nsc --version" 110 install: | 111 bin.install "nsc" 112