From ffc64d209a392afb3198acee3ee5449b7392e579 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:48:05 -0400 Subject: [PATCH] fix(ci): missing releases from HashiCorp Registry (#1118) Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- .github/workflows/publish.yml | 11 ++--------- .goreleaser.yml | 14 +++++++++++--- terraform-registry-manifest.json | 8 ++++++++ 3 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 terraform-registry-manifest.json diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8df5f280..b8e59e6f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,20 +28,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v5 with: - go-version-file: "go.mod" + fetch-depth: 0 - name: Import GPG key id: import_gpg uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 #v6.1.0 with: - git_user_signingkey: true gpg_private_key: "${{ secrets.GPG_PRIVATE_KEY }}" passphrase: "${{ secrets.PASSPHRASE }}" @@ -49,7 +42,7 @@ jobs: uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 #v5.0.0 with: version: latest - args: release --rm-dist + args: release --clean env: GPG_FINGERPRINT: "${{ steps.import_gpg.outputs.fingerprint }}" GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" diff --git a/.goreleaser.yml b/.goreleaser.yml index 991080b6..23f50b30 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,7 +2,8 @@ # behavior. before: hooks: - - go mod download + # this is just an example and not a requirement for provider building/publishing + - go mod tidy builds: - env: # goreleaser does not work with CGO, it could also complicate @@ -32,13 +33,16 @@ archives: - format: zip name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' checksum: + extra_files: + - glob: 'terraform-registry-manifest.json' + name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 signs: - artifacts: checksum args: # if you are using this in a GitHub action or some other automated pipeline, you - # need to pass the batch flag to indicate it's not interactive. + # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key @@ -47,6 +51,10 @@ signs: - "--detach-sign" - "${artifact}" release: - draft: false + extra_files: + - glob: 'terraform-registry-manifest.json' + name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' + # If you want to manually examine the release before its live, uncomment this line: + # draft: true changelog: skip: true diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 00000000..3ffa7837 --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,8 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": [ + "6.0" + ] + } +}