chore: add release-cut workflow

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
Khosrow Moossavi
2024-05-30 17:04:55 -04:00
parent dcdda6f504
commit 2b71b4da7e
2 changed files with 55 additions and 17 deletions

45
.github/workflows/cut-release.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: release-cut
on:
workflow_dispatch:
inputs:
version:
description: "The version to be released (without leading v)"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Prepare v${{ inputs.version }} Release
run: |
make release VERSION=${{ inputs.version }}
- name: Push v${{ inputs.version }} Changes
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
with:
file_pattern: "README.md docs/user-guide/installation.md internal/version/version.go"
commit_message: "Release version v${{ inputs.version }}"
commit_user_name: terraform-docs-bot
commit_user_email: bot@terraform-docs.io
commit_author: "terraform-docs-bot <bot@terraform-docs.io>"
- name: Cut v${{ inputs.version }} Release
run: |
git config --global user.name terraform-docs-bot
git config --global user.email bot@terraform-docs.io
git tag --annotate --message "v${{ inputs.version }} Release" "v${{ inputs.version }}"
git push origin "v${{ inputs.version }}"