chore(release): bump versions for v1.9.0 (#1996) #8
This file contains hidden or 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
| name: Release Helm Chart | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - bindings/python/pyproject.toml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| release: | |
| name: Package and push Helm chart | |
| if: github.repository == 'lightseekorg/smg' | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: release-helm-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Determine version | |
| id: version | |
| run: | | |
| VERSION=$(grep -m1 '^version = ' bindings/python/pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
| if [[ -z "${VERSION}" || ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then | |
| echo "::error::Failed to parse a valid version from bindings/python/pyproject.toml" | |
| exit 1 | |
| fi | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "Using version: ${VERSION}" | |
| - name: Sync Chart.yaml version and appVersion | |
| env: | |
| CHART_VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| sed -i "s/^version: .*/version: ${CHART_VERSION}/" deploy/helm/smg/Chart.yaml | |
| sed -i "s/^appVersion: .*/appVersion: \"${CHART_VERSION}\"/" deploy/helm/smg/Chart.yaml | |
| echo "Chart.yaml after sync:" | |
| grep -E '^(version|appVersion):' deploy/helm/smg/Chart.yaml | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: v3.17.0 | |
| - name: Lint chart | |
| run: helm lint deploy/helm/smg | |
| - name: Package chart | |
| run: | | |
| helm package deploy/helm/smg --destination .helm-pkg/ | |
| ls -lh .helm-pkg/ | |
| - name: Log in to GHCR | |
| env: | |
| HELM_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| HELM_USER: ${{ github.actor }} | |
| run: | | |
| echo "${HELM_PASSWORD}" | helm registry login ghcr.io -u "${HELM_USER}" --password-stdin | |
| - name: Push chart to GHCR | |
| env: | |
| CHART_VERSION: ${{ steps.version.outputs.version }} | |
| REPO_OWNER: ${{ github.repository_owner }} | |
| run: | | |
| helm push ".helm-pkg/smg-${CHART_VERSION}.tgz" "oci://ghcr.io/${REPO_OWNER}/charts" | |
| - name: Summary | |
| env: | |
| CHART_VERSION: ${{ steps.version.outputs.version }} | |
| REPO_OWNER: ${{ github.repository_owner }} | |
| run: | | |
| cat >> "$GITHUB_STEP_SUMMARY" <<EOF | |
| ### Helm Chart Published | |
| - **Chart:** smg | |
| - **Version:** ${CHART_VERSION} | |
| - **Registry:** \`oci://ghcr.io/${REPO_OWNER}/charts/smg\` | |
| **Install:** | |
| \`\`\`bash | |
| helm install smg oci://ghcr.io/${REPO_OWNER}/charts/smg --version ${CHART_VERSION} | |
| \`\`\` | |
| EOF |