-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (87 loc) · 2.73 KB
/
release-charts.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Release Charts
on:
workflow_dispatch:
inputs:
skip-checks:
description: "Skip checks before releasing?"
type: boolean
default: false
push:
branches:
- master
tags-ignore:
- "v**"
paths:
- 'charts/**/Chart.yaml'
concurrency:
group: release-charts-${{ github.ref }}
cancel-in-progress: true
env:
CHARTS_DIR: ./charts
HELM_DOCS_VERSION: 1.11.0
jobs:
determine-release-version:
runs-on: ubuntu-latest
outputs:
current: ${{ steps.release-version.outputs.version_tag }}
previous: v${{ steps.release-version.outputs.previous_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine Release-Version
id: release-version
uses: paulhatch/[email protected]
with:
tag_prefix: "v"
version_format: "${major}.${minor}.${patch}"
search_commit_body: true
check-charts:
if: github.event.inputs.skip-checks != 'true' && needs.determine-release-version.previous != 'v0.0.0'
needs:
- determine-release-version
uses: ./.github/workflows/checks.yml
with:
target-branch: ${{ needs.determine-release-version.previous }}
release-charts:
if: always() && !cancelled() && !failure() && needs.determine-release-version.previous != 'v0.0.0'
runs-on: ubuntu-latest
needs:
- determine-release-version
- check-charts
permissions:
contents: write
pages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Install helm-docs
run: "curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz \\\n https://github.com/norwoodj/helm-docs/releases/download/v\"${HELM_DOCS_VERSION}\"/helm-docs_\"${HELM_DOCS_VERSION}\"_Linux_x86_64.tar.gz\ntar -xf /tmp/helm-docs.tar.gz helm-docs \n #magic___^_^___line\n"
- name: Replace templates with actual README for charts
run: |
./helm-docs
find $CHARTS_DIR -type f -name README.md.gotmpl -exec rm {} +
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: ${{ env.CHARTS_DIR }}
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
CR_RELEASE_NAME_TEMPLATE: ${{ needs.determine-release-version.outputs.current }}
release-readmes:
uses: ./.github/workflows/release-readmes.yml
secrets: inherit
needs:
- release-charts
permissions:
contents: read
pages: write