Skip to content

Commit

Permalink
Update goreleaser to publish manifest file via hc-releases
Browse files Browse the repository at this point in the history
The recent goreleaser v1.3.0 release allows for custom publishers to declare `extra_files` configuration. This will allow us to upload the manifest file to releases.hashicorp.com, which should be ingested by the Terraform Registry to properly set protocol versions, rather than being reliant on the legacy and HashiCorp-only x-terraform-protocol-version(s) headers.

This also renames the manifest file slightly to match the documented convention at https://www.terraform.io/registry/providers/publishing#terraform-registry-manifest-file

```console
$ goreleaser --version
goreleaser version 1.3.0
commit: 3d2042cbf4d3b08a8395f0a4099e4bd31520dc24
built by: homebrew
goos: darwin
goarch: amd64

https://goreleaser.com
$ goreleaser check
   • loading config file       file=.goreleaser.yml
   • checking config:
   • config is valid
```
  • Loading branch information
bflad committed Jan 14, 2022
1 parent df5eb04 commit 3acd49b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ builds:
mod_timestamp: '{{ .CommitTimestamp }}'
checksum:
extra_files:
- glob: '{{ .ProjectName }}_manifest.json'
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
publishers:
- name: hc-releases
checksum: true
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
signature: true
cmd: hc-releases upload-file {{ abs .ArtifactPath }}
env:
Expand All @@ -43,7 +46,7 @@ publishers:
- AWS_SESSION_TOKEN={{ .Env.AWS_SESSION_TOKEN }}
release:
extra_files:
- glob: '{{ .ProjectName }}_manifest.json'
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
ids:
- none
Expand Down
File renamed without changes.

0 comments on commit 3acd49b

Please sign in to comment.