feat: add helm chart #24
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: chart-diff | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| KUBEBUILDER_VERSION: v4.11.1 | |
| GITOPS_PROMOTER_VERSION: e783f3e7c7bebf393659d5cd7b5f568d96d32efc # latest will be pinned to next release | |
| jobs: | |
| chart-diff: | |
| name: Chart Diff | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Install Helm | |
| run: | | |
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
| # - name: Get latest gitops-promoter release tag | |
| # id: get-release | |
| # run: | | |
| # LATEST_TAG=$(curl -s https://api.github.com/repos/argoproj-labs/gitops-promoter/releases/latest | jq -r '.tag_name') | |
| # echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT | |
| # echo "Latest release: $LATEST_TAG" | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: current-repo | |
| - name: Checkout gitops-promoter at latest release | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: argoproj-labs/gitops-promoter | |
| ref: ${{ env.GITOPS_PROMOTER_VERSION }} | |
| path: gitops-promoter | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Install kubebuilder | |
| run: | | |
| curl -L -o kubebuilder "https://github.com/kubernetes-sigs/kubebuilder/releases/download/${{ env.KUBEBUILDER_VERSION }}/kubebuilder_$(go env GOOS)_$(go env GOARCH)" | |
| chmod +x kubebuilder && sudo mv kubebuilder /usr/local/bin/ | |
| kubebuilder version | |
| - name: Run KubeBuilder | |
| working-directory: gitops-promoter | |
| run: | | |
| kubebuilder edit --plugins=helm/v2-alpha --output-dir=new_charts | |
| ls -la new_charts/* | |
| - name: Remove example blocks from generated CRDs | |
| run: | | |
| sed -i '/Example:/,/urlQueryEscape/d' gitops-promoter/new_charts/chart/templates/crd/argocdcommitstatuses.promoter.argoproj.io.yaml | |
| - name: Diff charts | |
| run: | | |
| echo "=== Diff between generated manifests and current Helm chart ===" | |
| diff -ruN --exclude='.git' --exclude='*.orig' --exclude='extra' gitops-promoter/new_charts/chart current-repo/chart > /tmp/chart-diff.diff || true | |
| if [ -s /tmp/chart-diff.diff ]; then | |
| echo "Differences found:" | |
| cat -n /tmp/chart-diff.diff | |
| exit 1 | |
| else | |
| echo "No differences found" | |
| fi | |
| - name: Upload diff artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: chart-diff | |
| path: /tmp/chart-diff.diff | |
| if-no-files-found: ignore |