-
Notifications
You must be signed in to change notification settings - Fork 27
79 lines (70 loc) · 2.31 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
73
74
75
76
77
78
79
on:
push:
tags:
- '**'
jobs:
release:
runs-on: ubuntu-22.04
container:
image: quay.io/helmpack/chart-releaser:v1.6.1
outputs:
version: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update version in Chart.yaml
run: |
sed -i "s|version: 0.0.0+dev|version: ${GITHUB_REF##*/}|" chart/Chart.yaml
- name: configure git
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
git config --global --add safe.directory /__w/charts/charts
- name: Release
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_OWNER: fusionauth
CR_GIT_REPO: charts
CR_PACKAGE_PATH: .deploy
CR_INDEX_PATH: index.yaml
CR_PAGES_BRANCH: main
CR_RELEASE_NAME_TEMPLATE: "{{ .Version }}"
run: |
cr package chart
cr upload
cr index --push
ARCHIVE=$(ls ${CR_PACKAGE_PATH})
echo "::set-output name=version::${ARCHIVE%.*}"
install:
runs-on: ubuntu-22.04
needs: release
steps:
- name: Set up helm
uses: azure/setup-helm@v3
- name: Set up kind
uses: helm/[email protected]
- name: Install the chart in kind
env:
CHARTS_REPO: https://fusionauth.github.io/charts
run: |
helm repo add fusionauth ${CHARTS_REPO}
helm install fusionauth fusionauth/fusionauth \
--set database.host=host \
--set database.user=user \
--set database.password=password \
--set search.host=host
- name: Verify the chart version
env:
RELEASED_VERSION: ${{ needs.release.outputs.version }}
run: |
INSTALLED_VERSION=$(helm list -m1 -f 'fusionauth*' -o json | jq -r '.[0].chart' )
if [[ "${RELEASED_VERSION}" != "${INSTALLED_VERSION}" ]]; then
echo "Incorrect Version Installed ..."
echo "Released Version: $RELEASED_VERSION"
echo "Installed Version: $INSTALLED_VERSION"
exit 1
else
echo "Installed $INSTALLED_VERSION as expected."
fi