-
Notifications
You must be signed in to change notification settings - Fork 12
68 lines (59 loc) · 2.05 KB
/
release-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
62
63
64
65
66
67
68
name: Release Chart
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name blobbot-helm
git config user.email [email protected]
- name: Get chart.yaml verison
id: chart_version
run: |
echo "CHART_VERSION=$(grep -o 'version: [0-9.]*' Chart.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: tag_exists
run: |
if ! git show-ref --verify --quiet "refs/tags/chart-${{ steps.chart_version.outputs.CHART_VERSION }}"; then
TAG_EXISTS=false
else
TAG_EXISTS=true
fi
echo "TAG_EXISTS=$TAG_EXISTS" >> $GITHUB_OUTPUT
- name: Tag release
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.chart_version.outputs.CHART_VERSION }}
tag_prefix: "chart-"
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
- name: Create release
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Publish Helm chart
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
uses: stefanprodan/helm-gh-pages@89c6698c192e70ed0e495bee7d3d1ca5b477fe82
with:
token: ${{ secrets.CHARTS_REPO_TOKEN }}
owner: benthosdev
repository: charts
branch: main
target_dir: benthos-captain
index_dir: .
charts_dir: chart/benthos-captain/
charts_url: https://benthosdev.github.io/charts
commit_username: blobbot-helm
commit_email: [email protected]