組織用にカスタム Terraform プロバイダーを作成しています。ここの指示に従っていました:
以下をワークフローディレクトリにコピーして GitHub Action を設定するように言及されているセクションで:
- terraform-provider-scaffolding リポジトリからの GitHub Actions ワークフロー ( https://github.com/hashicorp/terraform-provider-scaffolding/blob/main/.github/workflows/release.yml )
残念ながら、そうすると、release
ワークフローが機能しなくなり、実行されなくなったようです。その結果、これを terraform レジストリに接続しようとしているのですが、リリース設定が正しくないために公開できないため、全体的な洞察が得られることを期待していました。
レポは次のとおりです。
release.yml
これが、既存の で使用しているコードですworkflows
。
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2.4.0
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Import GPG key
id: import_gpg
uses: hashicorp/ghaction-import-gpg@v2.1.0
env:
# These secrets will need to be configured for the repository:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.8.0
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
私のレポでも自動タグ付けしている方法かもしれないと思います。これが私の中で使用しているものですtag.yml
:
name: 'tag'
on:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.4.0
- name: 'Tag'
uses: anothrNick/github-tag-action@1.36.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
また、tag
ワークフローは最初は機能していませんでしたが、現在は機能していますが、私のリリース ステータスは表示されているだけですno status