-
Notifications
You must be signed in to change notification settings - Fork 17
130 lines (114 loc) · 4.73 KB
/
publish-manual.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
130
name: "Republish given chart version"
on:
workflow_dispatch:
inputs:
tag:
description: 'Version tag'
required: true
type:
description: 'Name of the software that should be released. '
required: true
type: choice
options:
- stunner
- stunner-gateway-operator
- stunner-prometheus
env:
TAG: ${{ inputs.tag }}
TYPE: ${{ inputs.type }}
jobs:
push_chart:
runs-on: ubuntu-latest
steps:
- name: Log the received tag
run: |
echo "Version is $TAG"
echo "Triggered by $TYPE"
- name: stunner-helm checkout
uses: actions/checkout@v3
with:
path: stunner-helm
ref: main
repository: l7mp/stunner-helm
- name: l7mp.io checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.WEB_PAT_TOKEN }}
path: l7mp.io
ref: master
repository: l7mp/l7mp.io
- name: Set git config
run: |
git config --global user.email "[email protected]"
git config --global user.name "BotL7mp"
- name: Edit helm chart for stunner
if: ${{ env.TYPE == 'stunner'}}
run: |
cd stunner-helm/helm
if ${{ env.TAG == 'dev' }}; then
sed -ri 's/^(\s*)(name\s*:\s*.*\s*$)/\1name: stunner-dev/' stunner/Chart.yaml
sed -ri 's/^(\s*)( pullPolicy\s*:\s*.*\s*$)/\1 pullPolicy: Always/' stunner/values.yaml
else
sed -ri 's/^(\s*)(version\s*:\s*.*\s*$)/\1version: ${{ env.TAG }}/' stunner/Chart.yaml
fi
sed -ri 's/^(\s*)(appVersion\s*:\s*.*\s*$)/\1appVersion: ${{ env.TAG }}/' stunner/Chart.yaml
sed -ri 's/^(\s*)( tag\s*:\s*.*\s*$)/\1 tag: ${{ env.TAG }}/' stunner/values.yaml
- name: Edit helm chart for stunner-gateway-operator
if: ${{ env.TYPE == 'stunner-gateway-operator' }}
run: |
cd stunner-helm/helm
if ${{ env.TAG == 'dev' }}; then
sed -ri 's/^(\s*)(name\s*:\s*.*\s*$)/\1name: stunner-gateway-operator-dev/' stunner-gateway-operator/Chart.yaml
sed -ri 's/^(\s*)( pullPolicy\s*:\s*.*\s*$)/\1 pullPolicy: Always/' stunner-gateway-operator/values.yaml
sed -ri 's|^(\s*)( image: l7mp/stunnerd:latest$)| image: l7mp/stunnerd:dev|' stunner-gateway-operator/values.yaml
sed -ri 's|^(\s*)( tag\s*:\s*.*\s*$)| tag: dev|' stunner-gateway-operator/values.yaml
else
sed -ri 's/^(\s*)(version\s*:\s*.*\s*$)/\1version: ${{ env.TAG }}/' stunner-gateway-operator/Chart.yaml
fi
sed -ri 's/^(\s*)(appVersion\s*:\s*.*\s*$)/\1appVersion: ${{ env.TAG }}/' stunner-gateway-operator/Chart.yaml
sed -ri 's/^(\s*)( tag\s*:\s*.*\s*$)/\1 tag: ${{ env.TAG }}/' stunner-gateway-operator/values.yaml
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.3
- name: Set up chart-testing
uses: helm/chart-testing-action@v2
- name: Run chart-testing (lint)
run: |
cd stunner-helm
ct lint --all --chart-dirs helm --excluded-charts stunner-kurento-one2one-call
- name: Create kind cluster
uses: helm/[email protected]
- name: Run chart-testing (install)
run: |
cd stunner-helm
ct install --chart-dirs helm --charts helm/${{ env.TYPE }}
- name: Build helm chart for ${{ env.TYPE }}
run: |
cd stunner-helm/helm
helm package ${{ env.TYPE }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: latest
check-latest: false
- name: Update and deploy l7mp/l7mp.io repository
run: |
if ${{ env.TAG == 'dev' }}; then
rm -rf l7mp.io/public/stunner/${{ env.TYPE }}-dev*.tgz
else
rm -rf l7mp.io/public/stunner/${{ env.TYPE }}-${{ env.TAG }}.tgz
fi
cp stunner-helm/helm/*.tgz l7mp.io/public/stunner
helm repo index l7mp.io/public/stunner/ --url https://l7mp.io/stunner
cd l7mp.io
git add .
if ${{ env.TAG == 'dev' }}; then
git commit -m "Manual publish: Update dev helm chart from l7mp/${{ env.TYPE }}" -m "(triggered by the 'Helm release' github action.)"
else
git commit -m "Manual publish: Release helm chart from l7mp/${{ env.TYPE }}" -m "(triggered by the 'Helm release' github action.)"
fi
git push origin master
npm i
git remote set-url origin https://BotL7mp:${{ secrets.WEB_PAT_TOKEN }}@github.com/l7mp/l7mp.io.git
CI='' npm run deploy