|
| 1 | +# This is an example goreleaser.yaml file with some defaults. |
| 2 | +# Make sure to check the documentation at http://goreleaser.com |
| 3 | +env: |
| 4 | + - CGO_ENABLED=0 |
| 5 | +before: |
| 6 | + hooks: |
| 7 | + # We strongly recommend running tests to catch any regression before release. |
| 8 | + # Even though, this an optional step. |
| 9 | + - go test ./... |
| 10 | + # As part of the release doc files are included as a separate deliverable for |
| 11 | + # consumption by Packer.io. To include a separate docs.zip uncomment the following command. |
| 12 | + #- make ci-release-docs |
| 13 | +builds: |
| 14 | + # A separated build to run the packer-plugins-check only once for a linux_amd64 binary |
| 15 | + - |
| 16 | + id: plugin-check |
| 17 | + mod_timestamp: '{{ .CommitTimestamp }}' |
| 18 | + hooks: |
| 19 | + post: |
| 20 | + # This will check plugin compatibility against latest version of Packer |
| 21 | + - cmd: | |
| 22 | + go install github.com/hashicorp/packer/cmd/packer-plugins-check@latest && |
| 23 | + packer-plugins-check -load={{ .Name }} |
| 24 | + dir: "{{ dir .Path}}" |
| 25 | + flags: |
| 26 | + - -trimpath #removes all file system paths from the compiled executable |
| 27 | + ldflags: |
| 28 | + - '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= ' |
| 29 | + goos: |
| 30 | + - linux |
| 31 | + goarch: |
| 32 | + - amd64 |
| 33 | + binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}' |
| 34 | + - |
| 35 | + mod_timestamp: '{{ .CommitTimestamp }}' |
| 36 | + flags: |
| 37 | + - -trimpath #removes all file system paths from the compiled executable |
| 38 | + ldflags: |
| 39 | + - '-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= ' |
| 40 | + goos: |
| 41 | + - freebsd |
| 42 | + - windows |
| 43 | + - linux |
| 44 | + - darwin |
| 45 | + goarch: |
| 46 | + - amd64 |
| 47 | + - '386' |
| 48 | + - arm |
| 49 | + - arm64 |
| 50 | + ignore: |
| 51 | + - goos: darwin |
| 52 | + goarch: '386' |
| 53 | + - goos: linux |
| 54 | + goarch: amd64 |
| 55 | + binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}' |
| 56 | +archives: |
| 57 | +- format: zip |
| 58 | + files: |
| 59 | + - none* |
| 60 | + name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}' |
| 61 | +checksum: |
| 62 | + name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS' |
| 63 | + algorithm: sha256 |
| 64 | +signs: |
| 65 | + - artifacts: checksum |
| 66 | + args: |
| 67 | + # if you are using this is in a GitHub action or some other automated pipeline, you |
| 68 | + # need to pass the batch flag to indicate its not interactive. |
| 69 | + - "--batch" |
| 70 | + - "--local-user" |
| 71 | + - "{{ .Env.GPG_FINGERPRINT }}" |
| 72 | + - "--output" |
| 73 | + - "${signature}" |
| 74 | + - "--detach-sign" |
| 75 | + - "${artifact}" |
| 76 | +release: |
| 77 | + # If you want to manually examine the release before its live, uncomment this line: |
| 78 | + # draft: true |
| 79 | + # As part of the release doc files are included as a separate deliverable for consumption by Packer.io. |
| 80 | + # To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above. |
| 81 | + #extra_files: |
| 82 | + #- glob: ./docs.zip |
| 83 | + |
| 84 | +changelog: |
| 85 | + skip: true |
0 commit comments