-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 2.91 KB
/
publish.yaml
File metadata and controls
100 lines (86 loc) · 2.91 KB
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
name: Release a chart
on:
push:
branches:
- master
jobs:
release-core:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Helm tool installer
uses: azure/setup-helm@v1
with:
version: '3.5.4'
id: install
- name: Add dependency chart repos
run: |
helm repo add ecovadis https://ecovadiscode.github.io/charts/
- name: Remove all charts except core
run: |
find charts/ -mindepth 1 -maxdepth 1 -type d ! -name core -exec rm -rf {} +
- name: Run chart-releaser for core
uses: helm/chart-releaser-action@v1.4.0
with:
charts_dir: "charts"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
release-remaining:
needs: release-core
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Helm tool installer
uses: azure/setup-helm@v1
with:
version: '3.5.4'
id: install
- name: Add dependency chart repos
run: |
helm repo add ecovadis https://ecovadiscode.github.io/charts/
- name: Wait for core chart availability in Helm repo
run: |
# Find the highest core version required by any dependent chart
NEEDED_VERSION=$(grep -A1 'name: charts-core' charts/*/Chart.yaml | grep 'version:' | sed 's/.*version:[[:space:]]*//' | tr -d '"' | sort -V | tail -1)
if [ -z "$NEEDED_VERSION" ]; then
echo "No charts depend on charts-core, skipping wait."
exit 0
fi
echo "Highest charts-core version needed by dependent charts: ${NEEDED_VERSION}"
for i in $(seq 1 30); do
helm repo update 2>/dev/null
if helm search repo ecovadis/charts-core --version "${NEEDED_VERSION}" | grep -q "${NEEDED_VERSION}"; then
echo "charts-core ${NEEDED_VERSION} is available!"
exit 0
fi
echo "Attempt ${i}/30 - not yet available, waiting 10s..."
sleep 10
done
echo "Timeout waiting for charts-core ${NEEDED_VERSION} after 5 minutes"
exit 1
- name: Run chart-releaser for remaining charts
uses: helm/chart-releaser-action@v1.4.0
with:
charts_dir: "charts"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"