release.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Terraform Provider release workflow.
  2. name: Release
  3. # This GitHub action creates a release when a tag that matches the pattern
  4. # "v*" (e.g. v0.1.0) is created.
  5. on:
  6. push:
  7. tags:
  8. - 'v*'
  9. # Releases need permissions to read and write the repository contents.
  10. # GitHub considers creating releases and uploading assets as writing contents.
  11. permissions:
  12. contents: write
  13. jobs:
  14. goreleaser:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
  18. with:
  19. # Allow goreleaser to access older tag information.
  20. fetch-depth: 0
  21. - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
  22. with:
  23. go-version-file: 'go.mod'
  24. cache: true
  25. - name: Import GPG key
  26. uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
  27. id: import_gpg
  28. with:
  29. gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
  30. passphrase: ${{ secrets.PASSPHRASE }}
  31. - name: Run GoReleaser
  32. uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
  33. with:
  34. args: release --clean
  35. env:
  36. # GitHub sets the GITHUB_TOKEN secret automatically.
  37. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  38. GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}