-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.59 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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