Skip to content

Create Release

Create Release #15

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number of the new release'
required: true
type: string
permissions:
contents: write
pull-requests: write
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Update and create tag
run: |
# Setup git
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Update version in documentation and helm plugin config
sed -i 's\--version .*\--version ${{ inputs.version }}\g' docs/quick-start.md
sed -i 's\--version .*\--version ${{ inputs.version }}\g' README.md
sed -i 's\^version:.*\version: ${{ inputs.version }}\g' plugin.yaml
# Update changelog
sed -i 's\# Changes since .*\# ${{ inputs.version }}\g' CHANGELOG.md
echo -e "# Changes since ${{ inputs.version }}\n$(cat CHANGELOG.md)" > CHANGELOG.md
# Commit, tag and push
git commit -am "docs: release ${{ inputs.version }}"
git tag ${{ inputs.version }} -am "${{ inputs.version }}"
git push --follow-tags
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ inputs.version }}
run: |
gh release create "${TAG}" \
--title="${TAG}" \
--generate-notes \
--prerelease