|
| 1 | +# This is an example-real .goreleaser.yml file with some sensible defaults. |
| 2 | +# Make sure to check the documentation at https://goreleaser.com |
| 3 | +before: |
| 4 | + hooks: |
| 5 | + - go mod tidy |
| 6 | +builds: |
| 7 | +- targets: [go_first_class] |
| 8 | + mod_timestamp: '{{ .CommitTimestamp }}' |
| 9 | + flags: |
| 10 | + # trims path |
| 11 | + - -trimpath |
| 12 | + ldflags: |
| 13 | + # use commit date instead of current date as main.date |
| 14 | + # only needed if you actually use those things in your main package, otherwise can be ignored. |
| 15 | + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} |
| 16 | +checksum: |
| 17 | + name_template: 'checksums.txt' |
| 18 | +snapshot: |
| 19 | + name_template: "{{ incpatch .Version }}-next" |
| 20 | +changelog: |
| 21 | + sort: asc |
| 22 | + filters: |
| 23 | + exclude: |
| 24 | + - '^docs:' |
| 25 | + - '^test:' |
| 26 | + |
| 27 | +nfpms: |
| 28 | +- file_name_template: '{{ .ConventionalFileName }}' |
| 29 | + homepage: https://goreleaser.com |
| 30 | + description: Just another example |
| 31 | + maintainer: Carlos Alexandro Becker <[email protected]> |
| 32 | + license: MIT |
| 33 | + vendor: GoReleaser |
| 34 | + bindir: /usr/bin |
| 35 | + section: utils |
| 36 | + formats: [apk, deb, rpm] |
| 37 | + |
| 38 | +release: |
| 39 | + name_template: 'v{{ .Version }}' |
| 40 | + footer: | |
| 41 | + * * * |
| 42 | +
|
| 43 | + <a href="https://goreleser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a> |
| 44 | +
|
| 45 | + Find example-reals and commented usage of all options in our [website](https://goreleaser.com/intro/). |
| 46 | + Want to help? You can [sponsor](https://goreleaser.com/sponsors/),get a [Pro License](https://goreleaser.com/pro) or [contribute](https://goreleaser.com/contributing). |
| 47 | + Also, feel free to reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)! |
| 48 | +
|
| 49 | +
|
| 50 | +nightly: |
| 51 | + publish_release: true |
| 52 | + keep_single_release: true |
| 53 | + name_template: '{{ incminor .Version }}-nightly' |
| 54 | + tag_name: nightly |
| 55 | + |
| 56 | + |
| 57 | +dockers: |
| 58 | +- image_templates: |
| 59 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64' |
| 60 | + build_flag_templates: |
| 61 | + - "--pull" |
| 62 | + - "--label=org.opencontainers.image.description=Just an example-real" |
| 63 | + - "--label=org.opencontainers.image.created={{.Date}}" |
| 64 | + - "--label=org.opencontainers.image.name={{.ProjectName}}" |
| 65 | + - "--label=org.opencontainers.image.revision={{.FullCommit}}" |
| 66 | + - "--label=org.opencontainers.image.version={{.Version}}" |
| 67 | + - "--label=org.opencontainers.image.source={{.GitURL}}" |
| 68 | + - "--platform=linux/amd64" |
| 69 | + use: buildx |
| 70 | +- image_templates: |
| 71 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64' |
| 72 | + build_flag_templates: |
| 73 | + - "--pull" |
| 74 | + - "--label=org.opencontainers.image.description=Just an example-real" |
| 75 | + - "--label=org.opencontainers.image.created={{.Date}}" |
| 76 | + - "--label=org.opencontainers.image.name={{.ProjectName}}" |
| 77 | + - "--label=org.opencontainers.image.revision={{.FullCommit}}" |
| 78 | + - "--label=org.opencontainers.image.version={{.Version}}" |
| 79 | + - "--label=org.opencontainers.image.source={{.GitURL}}" |
| 80 | + - "--platform=linux/arm64" |
| 81 | + use: buildx |
| 82 | +- image_templates: |
| 83 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64' |
| 84 | + build_flag_templates: |
| 85 | + - "--pull" |
| 86 | + - "--label=org.opencontainers.image.description=Just an example-real" |
| 87 | + - "--label=org.opencontainers.image.created={{.Date}}" |
| 88 | + - "--label=org.opencontainers.image.name={{.ProjectName}}" |
| 89 | + - "--label=org.opencontainers.image.revision={{.FullCommit}}" |
| 90 | + - "--label=org.opencontainers.image.version={{.Version}}" |
| 91 | + - "--label=org.opencontainers.image.source={{.GitURL}}" |
| 92 | + - "--platform=windows/amd64" |
| 93 | + goos: windows |
| 94 | + dockerfile: windows.dockerfile |
| 95 | + |
| 96 | +docker_manifests: |
| 97 | +- name_template: 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}' |
| 98 | + image_templates: |
| 99 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64' |
| 100 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64' |
| 101 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64' |
| 102 | +- name_template: '{{ if not .IsNightly }}ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:latest{{ end }}' |
| 103 | + image_templates: |
| 104 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-amd64' |
| 105 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-arm64' |
| 106 | + - 'ghcr.io/caarlos0/goreleaser-pro-split-merge-example-real:v{{ .Version }}-windows-amd64' |
| 107 | + |
| 108 | +monorepo: |
| 109 | + tag_prefix: v # so it always filters out the nightly tag |
| 110 | + |
| 111 | + |
| 112 | +# signs the checksum file |
| 113 | +# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to |
| 114 | +# https://goreleaser.com/customization/sign |
| 115 | +signs: |
| 116 | +- cmd: cosign |
| 117 | + env: |
| 118 | + - COSIGN_EXPERIMENTAL=1 |
| 119 | + certificate: '${artifact}.pem' |
| 120 | + args: |
| 121 | + - sign-blob |
| 122 | + - '--output-certificate=${certificate}' |
| 123 | + - '--output-signature=${signature}' |
| 124 | + - '${artifact}' |
| 125 | + artifacts: checksum |
| 126 | + output: true |
| 127 | + |
| 128 | +# create a source tarball |
| 129 | +# https://goreleaser.com/customization/source/ |
| 130 | +source: |
| 131 | + enabled: true |
| 132 | + |
| 133 | +# creates SBOMs of all archives and the source tarball using syft |
| 134 | +# https://goreleaser.com/customization/sbom |
| 135 | +sboms: |
| 136 | +- artifacts: archive |
| 137 | +- id: source # Two different sbom configurations need two different IDs |
| 138 | + artifacts: source |
| 139 | + |
| 140 | +# signs our docker image |
| 141 | +# https://goreleaser.com/customization/docker_sign |
| 142 | +docker_signs: |
| 143 | +- cmd: cosign |
| 144 | + env: |
| 145 | + - COSIGN_EXPERIMENTAL=1 |
| 146 | + artifacts: images |
| 147 | + output: true |
| 148 | + args: |
| 149 | + - 'sign' |
| 150 | + - '${artifact}' |
| 151 | + |
| 152 | + |
| 153 | +# modelines, feel free to remove those if you don't want/use them: |
| 154 | +# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json |
| 155 | +# vim: set ts=2 sw=2 tw=0 fo=cnqoj |
0 commit comments