Skip to content

Operator v1.0.0 release #71

Operator v1.0.0 release

Operator v1.0.0 release #71

Workflow file for this run

name: Release Helm charts
on:
pull_request:
branches:
- main
push:
branches:
- main
paths:
- '**/Chart.yaml'
jobs:
get-list-of-charts:
runs-on: ubuntu-latest
name: 'Get list of charts to be released'
outputs:
charts: ${{ steps.get-charts.outputs.charts }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: get-charts
name: Get list of charts to be released
shell: bash
run: |
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"
fi
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) }}
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: v3.5.3
- name: Read Helm Chart version
id: chart-version
run: echo "version=$(awk '/^version:/ {print $2}' ${{ matrix.chart }}/Chart.yaml)" >> "$GITHUB_OUTPUT"
- name: Helm Chart package file name
id: file-name
run: |
echo "fileName=$(basename ${{ matrix.chart }})-${{ steps.chart-version.outputs.version }}.tgz"
echo "fileName=$(basename ${{ matrix.chart }})-${{ steps.chart-version.outputs.version }}.tgz" >> "$GITHUB_OUTPUT"
- name: Update dependencies
run: helm dependency update ${{ matrix.chart }}
- name: Package Helm Chart
run: helm package ${{ matrix.chart }} --version ${{ steps.chart-version.outputs.version }}
- 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 }}"