name: Release Helm Chart on: release: types: [published] jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm uses: azure/setup-helm@v3 with: version: v3.12.0 - name: Create test values run: | cat > charts/ci-values.yaml << EOF credentials: ibm_api_key: "ci-test-key" region: "us-south" vpc_api_key: "ci-test-vpc-key" vpc_url: "https://us-south.iaas.cloud.ibm.com/v1" EOF - name: Create yamllint config run: | cat > .yamllint << EOF extends: default rules: document-start: disable line-length: disable EOF - name: Run tests working-directory: charts run: | # Lint chart with test values helm lint . -f values.yaml # Validate template rendering helm template . -f values.yaml # Validate CRDs for crd in crds/*.yaml; do if [ -f "$crd" ]; then echo "Validating $crd" cat "$crd" | yamllint -c ../.yamllint - fi done - name: Run chart-releaser uses: helm/chart-releaser-action@v1.5.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" with: charts_dir: charts - name: Package Helm Chart run: | helm package charts/ --destination .cr-release-packages/ - name: Upload Helm Chart uses: actions/upload-artifact@v3 with: name: helm-chart path: .cr-release-packages/*.tgz retention-days: 5