-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (60 loc) · 2.16 KB
/
release.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
name: Release Charts
on:
push:
branches:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set lib version
run: |
LIB_VERSION=$(sed -n '/version/{s/version: //;p;}' charts/helm-apps/Chart.yaml)
sed -i 's/_FLANT_APPS_LIBRARY_VERSION_/'${LIB_VERSION}'/' charts/helm-apps/templates/_apps-version.tpl
- name: Install werf CLI
with:
channel: ea
uses: werf/actions/[email protected]
- name: Install Helm3
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Install Dyff
run: |
sudo snap install dyff
- name: Render
run: |
set -e
source $(werf ci-env github --as-file)
cd tests && werf render --dev --set "global._includes.apps-defaults.enabled=true" --env=prod
- name: Test render
run: |
set -e
source $(werf ci-env github --as-file)
cd tests && werf render --dev --set "global._includes.apps-defaults.enabled=true" --env=prod | sed '/werf.io\//d' > test_render_check.yaml
dyff between test_render.yaml test_render_check.yaml | tee /tmp/test_render_check
#check_tests=$(sed 1,7d /tmp/test_render_check | wc -l)
#if [ $check_tests -gt "7" ]; then exit 1; fi
- name: Run chart-releaser
if: ${{ github.ref == 'refs/heads/main' }}
uses: helm/[email protected]
with:
charts_dir: charts
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# - name: Publish to CR
# env:
# CR_PAT: ${{ secrets.CR_PAT }}
# run: |
# echo $CR_PAT | helm registry login -u alvnukov --password-stdin ghcr.io
# find .cr-release-packages -mindepth 1 -maxdepth 1 -type f -name '*.tgz' -exec sh -c 'basename "$0"' '{}' \; | while read PACKAGE; do
# helm push .cr-release-packages/$PACKAGE oci://ghcr.io/${GITHUB_REPOSITORY}
# done