workaround for mcp #244
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 Charts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| 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 | |
| id: install | |
| uses: azure/setup-helm@v4 | |
| env: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Prepare chart with local dependencies | |
| run: | | |
| cd charts/mcp-server | |
| # Backup original Chart.yaml | |
| cp Chart.yaml Chart.yaml.bak | |
| # Remove the repository line for the unla dependency to make it use local file | |
| awk ' | |
| BEGIN { in_block = 0 } | |
| /^dependencies:/ { in_block = 1; print; next } | |
| in_block && /^[[:space:]]*-/ && !/- name:/ { in_block = 0; print; next } | |
| in_block && /name: unla/ { print; next_line_check = 1; next } | |
| next_line_check && /^[[:space:]]*repository:/ { next_line_check = 0; next } | |
| { print; next_line_check = 0 } | |
| ' Chart.yaml.bak > Chart.yaml | |
| cd ../.. | |
| - name: Run chart-releaser | |
| uses: helm/chart-releaser-action@v1 | |
| with: | |
| skip_existing: true | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Restore original Chart.yaml | |
| if: always() | |
| run: | | |
| cd charts/mcp-server | |
| if [ -f Chart.yaml.bak ]; then | |
| mv Chart.yaml.bak Chart.yaml | |
| fi | |
| cd ../.. | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push Charts to GHCR | |
| run: | | |
| if [ -d ".cr-release-packages" ]; then | |
| for pkg in .cr-release-packages/*; do | |
| if [ -z "${pkg:-}" ]; then | |
| break | |
| fi | |
| helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts | |
| done | |
| else | |
| echo "Directory .cr-release-packages does not exist." | |
| fi |