-
-
Notifications
You must be signed in to change notification settings - Fork 273
99 lines (96 loc) · 3.4 KB
/
helm.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
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
name: Helm
on:
push:
paths:
- "helm-chart/**"
- ".github/workflows/helm.yaml"
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.5.0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.5.1
- name: Lint chart
run: ct lint --charts helm-chart/sefaria-project
chart:
name: Release Chart
runs-on: ubuntu-latest
permissions:
contents: write # needed to write releases
needs:
- lint
if: |
(github.repository == 'sefaria/sefaria-project')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Fetch entire history. Required for chart-releaser; see https://github.com/helm/chart-releaser-action/issues/13#issuecomment-602063896
fetch-depth: 0
- name: fetch head of branch to ensure semantic can run
run: git pull origin $GITHUB_REF
- name: create release rules
run: helm-chart/release-rules.sh
- uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
working_directory: ./helm-chart
semantic_version: 18.0.1
extra_plugins: |
@semantic-release/[email protected]
extends: |
semantic-release-monorepo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup
shell: bash
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
- name: Get appVersion
id: appVersion
run: |
echo "appVersion=$(git describe --match 'v*' --abbrev=0 HEAD --tags)" >> $GITHUB_OUTPUT
- name: Get chartVersion
id: chartVersion
run: |
if [[ -z "${{ steps.semantic.outputs.new_release_version }}" ]]; then
if [[ -z "$(git tag --points-at HEAD -l 'helm*')" ]]; then
echo "No chart version available"
exit 1
else
echo "chartVersion=$(git tag --points-at HEAD -l 'helm*' | sed 's/helm-chart-//' )" >> $GITHUB_OUTPUT
fi
else
echo "chartVersion=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_OUTPUT
fi
- name: Download yq
run: |
wget -nv -nc -O yq https://github.com/mikefarah/yq/releases/download/v4.20.2/yq_linux_amd64
chmod +x yq
- name: Update chart version
run: ./yq -i e '.version = "${{ steps.chartVersion.outputs.chartVersion }}"' helm-chart/sefaria-project/Chart.yaml
- name: Update chart appVersion
run: ./yq -i e '.appVersion = "${{ steps.appVersion.outputs.appVersion }}"' helm-chart/sefaria-project/Chart.yaml
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
chart_version: ${{ steps.semantic.outputs.new_release_version }}
app_version: ${{ steps.appVersion.outputs.appVersion }}
charts_dir: helm-chart