-
Notifications
You must be signed in to change notification settings - Fork 3
121 lines (102 loc) · 4.58 KB
/
release-dispatch.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
name: Release Helm Chart - dispatch
on:
repository_dispatch:
types: [trigger-workflow-testkube-cloud-api, trigger-workflow-testkube-cloud-ui]
jobs:
release-helm-charts:
name: Release Helm Charts
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install yq
uses: mikefarah/yq@v4
- name: Install Helm
uses: azure/setup-helm@v3
- name: Update Helm chart
run: |
./scripts/update.sh \
-c ${{ github.event.client_payload.app }} \
-a ${{ github.event.client_payload.appVersion }} \
--verbose
echo -e "### ${{ github.event.client_payload.app }} Helm chart diff" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
git --no-pager diff >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
chart_version=$(./scripts/update.sh -c ${{ github.event.client_payload.app }} --print-chart-version)
echo "CHART_VERSION=$chart_version" >> $GITHUB_ENV
- name: Update Testkube Enterprise Helm chart
run: |
echo "Syncing subchart versions in testkube-enterprise Helm chart"
./scripts/sync.sh
echo -e "### Testkube Enterprise Helm chart diff" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
git --no-pager diff charts/testkube-enterprise >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
enterprise_chart_version=$(./scripts/update.sh -c testkube-enterprise --print-chart-version)
echo "ENTERPRISE_CHART_VERSION=$enterprise_chart_version" >> $GITHUB_ENV
- name: Lint Helm charts for safety
run: |
helm lint charts/*
- name: Package charts & update Helm repo index
run: |
echo "Packaging ${{ github.event.client_payload.app }} chart"
helm package charts/${{ github.event.client_payload.app }} --destination charts
echo "Packaging testkube-enterprise chart"
helm package charts/testkube-enterprise --destination charts
helm repo index .
- name: Commit & push changes
run: |
git config --global user.name "testkube-cloud-ci-bot"
git config --global user.email "testkube-cloud-ci-bot@users.noreply.github.com"
git status
git add .
git commit -m "updating chart ${{ github.event.client_payload.app }} version to "${{ env.CHART_VERSION }}" and appVersion to ${{ github.event.client_payload.appVersion }}; Updating testkube-enterprise chart version to ${{ env.ENTERPRISE_CHART_VERSION }}."
git push
- name: Bump version and push tag
id: tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
- name: Changelog
uses: scottbrenner/generate-changelog-action@master
id: changelog
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag.outputs.new_tag }}
name: ${{ steps.tag.outputs.new_tag }}
body: ${{ steps.changelog.outputs.changelog }}
artifacts: |
charts/*.tgz
- name: Release to Keygen
uses: getgrit/keygen-action@main
with:
# Required: Keygen Account ID or slug
account-id: "${{ secrets.KEYGEN_ACCOUNT_ID }}"
# Required: A Product or User Token (ref. https://keygen.sh/docs/api/authentication/#token-authentication)
token: "${{ secrets.KEYGEN_TESTKUBE_ENTERPRISE_PRODUCT_TOKEN }}"
# Required: Product ID
product-id: "${{ secrets.KEYGEN_TESTKUBE_ENTERPRISE_PRODUCT_ID }}"
# Required (boolean): true to publish the created release; false to keep it in the DRAFT state.
release-publish: true
# Optional
release-name: 'Testkube Enterprise v${{ env.ENTERPRISE_CHART_VERSION }}'
# Required: must be a valid semver value, without the `v` prefix
release-version: '${{ env.ENTERPRISE_CHART_VERSION }}'
# Required
release-channel: 'stable'
# Optional
release-tag: 'latest'
artifacts-json: |
[
{
"filepath": "./charts/testkube-enterprise-${{ env.ENTERPRISE_CHART_VERSION }}.tgz",
"platform": "linux",
"arch": "amd64"
}
]