Skip to content

Release 1.17.0 for Packmind 1.15.1 #71

Release 1.17.0 for Packmind 1.15.1

Release 1.17.0 for Packmind 1.15.1 #71

Workflow file for this run

name: Helm Chart CI/CD
on:
push:
branches: [ "main" ]
tags: [ "release/*" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
lint-test:
name: Lint and Test Charts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: 'v3.17.0'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --chart-dirs . --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config .github/ct.yaml
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.12.0
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config .github/ct.yaml
release:
name: Release Charts
runs-on: ubuntu-latest
needs: lint-test
if: startsWith(github.ref, 'refs/tags/release/')
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
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@v4
with:
version: 'v3.17.0'
- name: Extract version from tag
id: get_version
run: |
# Extract version from tag (e.g., release/1.2.3 -> 1.2.3)
VERSION=$(echo ${GITHUB_REF} | sed 's|refs/tags/release/||')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Extracted version: ${VERSION}"
- name: Update Chart.yaml version
run: |
VERSION="${{ steps.get_version.outputs.version }}"
echo "Updating Chart.yaml version to ${VERSION}"
# Update the version in Chart.yaml
sed -i "s/^version: .*/version: ${VERSION}/" packmind/Chart.yaml
# Update appVersion to match (optional)
sed -i "s/^appVersion: .*/appVersion: \"${VERSION}\"/" packmind/Chart.yaml
echo "Updated Chart.yaml:"
cat packmind/Chart.yaml
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0
with:
charts_dir: .
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: true