forked from truecharts/public
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (109 loc) · 3.97 KB
/
charts-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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: "Charts: Release"
concurrency: helm-release
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "charts/**"
jobs:
release-helm:
runs-on: actions-runner-large
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0
- name: Get Changelog Format Version
shell: bash
run: |
ver=$(./charttool genchangelog format-version)
key="changelog-json-format-$ver"
echo "Cache Key is: $key"
echo "CHANGELOG_CACHE_KEY=$key" >> $GITHUB_ENV
- name: Cache Changelog
id: cache-changelog
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: changelog.json.gz
key: ${{ env.CHANGELOG_CACHE_KEY }}
- name: Generate Changelog
shell: bash
run: |
export REPO_PATH="./"
export TEMPLATE_PATH="./templates/CHANGELOG.md.tmpl"
export OUTPUT_DIR="./changelogs"
export JSON_FILE="changelog.json"
ls -l
if [ -f "$JSON_FILE.gz" ]; then
gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists
fi
./charttool genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR"
gzip "$JSON_FILE" --best
- name: Checkout Helm-Staging
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 1
repository: truecharts/helm-staging
token: ${{ secrets.BOT_TOKEN }}
path: helm
- name: Fix Pre-Commit issues
shell: bash
run: |
echo "Running pre-commit test-and-cleanup..."
pre-commit run --all ||:
# Fix sh files to always be executable
find . -name '*.sh' | xargs chmod +x
- name: Commit Helm Changes
run: |
rm -rf helm/charts
mkdir helm/charts
cp -rf charts helm
echo "Copying changelogs to helm"
cp -r ./changelogs/** ./helm/charts/
- name: Commit Helm Changes
run: |
cd helm
git config user.name "TrueCharts-Bot"
git config user.email "[email protected]"
git add --all
git commit -sm "Commit released Helm Charts for TrueCharts" || exit 0
git push
cd -
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 1
repository: truecharts/website
token: ${{ secrets.BOT_TOKEN }}
path: website
- name: Copy docs to website
shell: bash
run: |
#!/bin/bash
echo "Maing sure directories exist..."
mkdir -p website/public/img/hotlink-ok/chart-icons || echo "chart-icons path already exists, continuing..."
mkdir -p website/public/img/hotlink-ok/chart-icons-small || echo "chart-icons-small path already exists, continuing..."
mkdir -p website/src/assets || echo "assets path already exists, continuing..."
./charttool genchartlist ./charts
mv charts.json website/src/assets/charts.json
echo "Copying changelogs to docs"
cp -r ./changelogs/** ./website/src/content/docs/charts/
export DEBUG=false
export STRICT=true
go-yq --version
for item in charts/*/*/Chart.yaml; do
# TODO: Move all website docs structure generation to charttool
IFS='/' read -r -a chart_parts <<<"$item"
./.github/scripts/chart-docs.sh "${chart_parts[1]}/${chart_parts[2]}"
done
- name: Commit Website Changes
run: |
cd website
git config user.name "TrueCharts-Bot"
git config user.email "[email protected]"
git add --all
git commit -sm "Commit released docs for TrueCharts" || exit 0
git push