|
1 |
| -# Visit https://goreleaser.com for documentation on how to customize this |
2 |
| -# behavior. |
| 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 |
3 | 5 | before:
|
4 | 6 | hooks:
|
5 |
| - # You may remove this if you don't use go modules. |
6 |
| - - go mod download |
| 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 | + #- /bin/sh -c "[ -d docs ] && zip -r docs.zip docs/" |
7 | 13 | builds:
|
8 |
| -- env: |
9 |
| - # goreleaser does not work with CGO, it could also complicate |
10 |
| - # usage by users in CI/CD systems like Terraform Cloud where |
11 |
| - # they are unable to install libraries. |
12 |
| - - CGO_ENABLED=0 |
13 |
| - mod_timestamp: '{{ .CommitTimestamp }}' |
14 |
| - flags: |
15 |
| - - -trimpath |
16 |
| - ldflags: |
17 |
| - - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' |
18 |
| - goos: |
19 |
| - - linux |
20 |
| - - windows |
21 |
| - - darwin |
22 |
| - goarch: |
23 |
| - - amd64 |
24 |
| - - '386' |
25 |
| - - arm |
26 |
| - - arm64 |
27 |
| - ignore: |
28 |
| - - goos: darwin |
29 |
| - goarch: '386' |
30 |
| - binary: '{{ .ProjectName }}_v{{ .Version }}' |
| 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 main.Version={{.Version}} -X main.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 main.version={{.Version}} -X main.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 }}' |
31 | 56 | archives:
|
32 | 57 | - format: zip
|
33 |
| - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' |
| 58 | + files: |
| 59 | + - none* |
| 60 | + name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}' |
34 | 61 | checksum:
|
35 |
| - name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' |
| 62 | + name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS' |
36 | 63 | algorithm: sha256
|
37 | 64 | signs:
|
38 | 65 | - artifacts: checksum
|
39 | 66 | args:
|
40 |
| - # if you are using this is a GitHub action or some other automated pipeline, you |
| 67 | + # if you are using this is in a GitHub action or some other automated pipeline, you |
41 | 68 | # need to pass the batch flag to indicate its not interactive.
|
42 | 69 | - "--batch"
|
43 | 70 | - "--local-user"
|
44 |
| - - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key |
| 71 | + - "{{ .Env.GPG_FINGERPRINT }}" |
45 | 72 | - "--output"
|
46 | 73 | - "${signature}"
|
47 | 74 | - "--detach-sign"
|
48 | 75 | - "${artifact}"
|
49 | 76 | release:
|
50 |
| - # Visit your project's GitHub Releases page to publish this release. |
| 77 | + # If you want to manually examine the release before its live, uncomment this line: |
51 | 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 | + |
52 | 84 | changelog:
|
53 |
| - sort: asc |
54 |
| - filters: |
55 |
| - exclude: |
56 |
| - - '^docs:' |
57 |
| - - '^test:' |
| 85 | + skip: true |
0 commit comments