-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Burak Sekili <[email protected]> release operator v1.0.0 chart Signed-off-by: Burak Sekili <[email protected]> op Signed-off-by: Burak Sekili <[email protected]> release operator v1.0.0 chart Signed-off-by: Burak Sekili <[email protected]> op Signed-off-by: Burak Sekili <[email protected]> op Signed-off-by: Burak Sekili <[email protected]>
- Loading branch information
1 parent
d1a599f
commit f43ab22
Showing
2 changed files
with
20 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
name: Release Helm charts | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**/Chart.yaml' | ||
|
||
jobs: | ||
get-list-of-charts: | ||
get-list-of-charts: | ||
runs-on: ubuntu-latest | ||
name: 'Get list of charts to be released' | ||
outputs: | ||
|
@@ -19,33 +22,24 @@ jobs: | |
fetch-depth: 0 | ||
- id: get-charts | ||
name: Get list of charts to be released | ||
shell: bash | ||
run: | | ||
# Get list of Chart.yaml files changed in the last commit | ||
files_changed="$(git show --pretty="" --name-only | grep Chart.yaml)" | ||
charts=() | ||
for file in $files_changed; do | ||
count=$(git show "$file" | grep -c "+version" || true) | ||
if [ $count -eq 0 ]; then | ||
echo "No version change in $file" | ||
continue | ||
fi | ||
charts+=("$(echo "$file" | xargs dirname)") | ||
done | ||
set -e | ||
set -x | ||
charts=("components/tyk-operator") | ||
echo "Charts array: ${charts[@]}" | ||
if [ ${#charts[@]} -eq 0 ]; then | ||
echo "No charts to be released" | ||
echo "charts=none" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "charts=$(jq 'split(" ")' -Rc <(echo ${charts[@]}))" >> "$GITHUB_OUTPUT" | ||
echo "charts=$(jq 'split(" ")' -Rc <(echo ${charts[@]}))" >> "$GITHUB_OUTPUT" | ||
fi | ||
release-charts: | ||
release-charts: | ||
runs-on: ubuntu-latest | ||
needs: get-list-of-charts | ||
if: needs.get-list-of-charts.outputs.charts != 'none' | ||
|
||
strategy: | ||
matrix: | ||
chart: ${{ fromJson(needs.get-list-of-charts.outputs.charts) }} | ||
|
@@ -78,9 +72,9 @@ jobs: | |
- name: Push Helm Chart | ||
uses: cloudsmith-io/[email protected] | ||
with: | ||
api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
command: "push" | ||
format: "helm" | ||
owner: "tyk" | ||
repo: "helm" | ||
file: "${{ steps.file-name.outputs.fileName }}" | ||
api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
command: "push" | ||
format: "helm" | ||
owner: "tyk" | ||
repo: "helm" | ||
file: "${{ steps.file-name.outputs.fileName }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
apiVersion: v2 | ||
name: tyk-operator | ||
description: A Helm chart to install the tyk-operator | ||
version: 1.0.0 | ||
type: application | ||
version: 1.0.0 # version of the chart |