Fix helm values #4
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: Auto Release ktool | |
| on: | |
| push: | |
| branches: | |
| - ktool | |
| paths: | |
| - 'kubectl-ktool.sh' | |
| - '.github/workflows/publish-package.yaml' # Rerun if the workflow changes | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| - name: Extract version from kubectl-ktool.sh script | |
| id: extract_version | |
| run: | | |
| version=$(grep '^VERSION=' kubectl-ktool.sh | head -n1 | cut -d'"' -f2) | |
| if [[ -z "$version" ]]; then | |
| echo "ERROR: Version not found in script" | |
| exit 1 | |
| fi | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - name: Show extracted version | |
| run: | | |
| echo "Extracted version: ${{ steps.extract_version.outputs.version }}" | |
| - name: Ensure script executable | |
| run: | | |
| chmod +x ./kubectl-ktool.sh | |
| - name: Create git tag (if not exists) | |
| id: tag | |
| run: | | |
| version="ktool-${{ steps.extract_version.outputs.version }}" | |
| if git rev-parse "$version" >/dev/null 2>&1; then | |
| echo "Tag $version already exists" | |
| else | |
| git tag "$version" | |
| git push origin "$version" | |
| echo "Tag $version created and pushed" | |
| fi | |
| - name: Upload script as artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | |
| with: | |
| name: kubectl-ktool-${{ steps.extract_version.outputs.version }} | |
| path: ./kubectl-ktool.sh |