-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (54 loc) · 1.91 KB
/
bump-chart.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
54
55
56
57
58
59
60
61
name: Create Release
on:
workflow_call:
inputs:
chart-name:
description: 'The name of the chart'
required: true
type: string
app-version:
description: 'The new app-version'
required: true
type: string
secrets:
token:
description: 'The github token to use to create the PR'
required: true
jobs:
update-app-version:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
repository: spotinst/charts
- uses: gabe565/setup-helm-docs-action@v1.0.3
with:
version: v1.13.1
- name: Clean version
id: clean-version
run: |
VERSION_INPUT=${{ inputs.app-version }}
echo "version=${VERSION_INPUT#v}" >> $GITHUB_OUTPUT
- name: Bump version
uses: mikefarah/yq@v4.40.4
with:
cmd: |
yq -i '.appVersion = "${{ steps.clean-version.outputs.version }}"' ./charts/${{ inputs.chart-name }}/Chart.yaml
yq -i '.version |= (split(".") | .[-1] |= ((. tag = "!!int") + 1) | join("."))' ./charts/${{ inputs.chart-name }}/Chart.yaml
- name: Update helm docs
run: |
helm-docs --chart-to-generate charts/${{ inputs.chart-name }}
- name: Generate version bump commit
run: |
git config user.name ${{ github.actor }}
git config user.email '${{ github.actor }}@users.noreply.github.com'
git commit -a -m "bump ${{ inputs.chart-name }} app version to ${{ steps.clean-version.outputs.version }}"
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.token }}
title: '[bump] ${{ inputs.chart-name }} - ${{inputs.app-version}}'
branch: bump/${{ inputs.chart-name }}_${{inputs.app-version}}
delete-branch: true
labels: auto_version_bump