diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25fdfc4..8d51eba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,25 +1,32 @@ -# Terraform Provider release workflow. name: Release -# This GitHub action creates a release when a tag that matches the pattern -# "v*" (e.g. v0.1.0) is created. on: push: - tags: - - 'v*' + branches: ["main"] -# Releases need permissions to read and write the repository contents. -# GitHub considers creating releases and uploading assets as writing contents. permissions: contents: write + issues: write + pull-requests: write jobs: + tagpr: + runs-on: ubuntu-latest + outputs: + tagpr-tag: ${{ steps.tagpr.outputs.tag }} + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - id: tagpr + uses: Songmu/tagpr@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} goreleaser: + needs: tagpr + if: "steps.tagpr.outputs.tag != ''" runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: - # Allow goreleaser to access older tag information. fetch-depth: 0 - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: @@ -37,6 +44,5 @@ jobs: args: release --clean version: "~> v2" env: - # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.tagpr b/.tagpr new file mode 100644 index 0000000..7dbc992 --- /dev/null +++ b/.tagpr @@ -0,0 +1,6 @@ +[tagpr] + vPrefix = true + releaseBranch = main + versionFile = version + changelog = false + release = false diff --git a/README.md b/README.md index 17ea5a8..dc6cb06 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,7 @@ You can debug developing provider using following steps: - Edit `~/.terraformrc` using the output comment - `cd examples/resources/zoom_phone_autoreceiptionist` - `TF_LOG_PROVIDER=debug terraform apply` + +## Release + +We use release management by [tagpr](https://github.com/Songmu/tagpr). When merging tagpr PR, next version would be released by github-actions.