|
| 1 | +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json |
| 2 | +version: 2 |
| 3 | +project_name: protoc-gen-connect-go |
| 4 | + |
| 5 | +before: |
| 6 | + hooks: |
| 7 | + # connect.go's Version constant is edited by hand (RELEASE.md step 2) and is |
| 8 | + # what the plugin reports via --version, while the archive names below come |
| 9 | + # from the git tag. Nothing else checks that the two agree, so a missed edit |
| 10 | + # would silently ship mislabelled binaries. Skipped for snapshot builds, |
| 11 | + # where there is no release tag to compare against. |
| 12 | + - sh -c 'if [ "{{ .IsSnapshot }}" != "true" ]; then version="v$(go run ./cmd/protoc-gen-connect-go --version)"; if [ "$version" != "{{ .Tag }}" ]; then echo "connect.Version is $version, but the release tag is {{ .Tag }}" >&2; exit 1; fi; fi' |
| 13 | + |
| 14 | +builds: |
| 15 | + - id: protoc-gen-connect-go |
| 16 | + binary: protoc-gen-connect-go |
| 17 | + main: ./cmd/protoc-gen-connect-go |
| 18 | + env: |
| 19 | + - CGO_ENABLED=0 |
| 20 | + goos: |
| 21 | + - linux |
| 22 | + - darwin |
| 23 | + - windows |
| 24 | + goarch: |
| 25 | + - amd64 |
| 26 | + - arm64 |
| 27 | + ldflags: |
| 28 | + # Omit the symbol table and DWARF data, this is not a debuggable artifact. |
| 29 | + - -s -w |
| 30 | + |
| 31 | +archives: |
| 32 | + - formats: [tar.gz] |
| 33 | + format_overrides: |
| 34 | + - goos: windows |
| 35 | + formats: [zip] |
| 36 | + # Matches the naming used by bufbuild/buf and connectconformance releases. |
| 37 | + name_template: >- |
| 38 | + protoc-gen-connect-go- |
| 39 | + {{- .Tag }}- |
| 40 | + {{- title .Os }}- |
| 41 | + {{- if and (eq .Os "linux") (eq .Arch "arm64") }}aarch64 |
| 42 | + {{- else if eq .Arch "amd64" }}x86_64 |
| 43 | + {{- else }}{{ .Arch }}{{ end }} |
| 44 | + files: |
| 45 | + - LICENSE |
| 46 | + |
| 47 | +checksum: |
| 48 | + # The default template uses .Version, which renders without the leading "v" |
| 49 | + # that the archives above use. Pin it so the whole release is consistent. |
| 50 | + name_template: 'protoc-gen-connect-go-{{ .Tag }}-checksums.txt' |
| 51 | + |
| 52 | +changelog: |
| 53 | + # Release notes are written by hand in the GitHub UI, so there is nothing to |
| 54 | + # generate here. Skipping it also avoids walking history that the release |
| 55 | + # workflow's shallow checkout doesn't have. |
| 56 | + disable: true |
| 57 | + |
| 58 | +release: |
| 59 | + github: |
| 60 | + owner: connectrpc |
| 61 | + name: connect-go |
| 62 | + # Releases are created and their notes curated by hand in the GitHub UI, as |
| 63 | + # described in RELEASE.md. This only attaches artifacts to the existing |
| 64 | + # release. |
| 65 | + mode: keep-existing |
0 commit comments