ci: disable tests in release workflow for faster releases #5
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| env: | |
| GO_VERSION: '1.21' | |
| REGISTRY: docker.io | |
| IMAGE_NAME: supporttools/node-doctor | |
| jobs: | |
| # Build and push Docker images | |
| docker: | |
| name: Build & Push Docker Images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest,enable=${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'alpha') }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| VERSION=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| BUILD_TIME=${{ github.event.head_commit.timestamp }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v3 | |
| with: | |
| cosign-release: 'v2.2.2' | |
| - name: Sign Docker image | |
| env: | |
| COSIGN_EXPERIMENTAL: 1 | |
| run: | | |
| echo "Signing Docker image with cosign (keyless)..." | |
| cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| echo "✅ Docker image signed" | |
| - name: Generate Docker summary | |
| run: | | |
| echo "## 🐳 Docker Images" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Tag:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Images Published" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Platforms:** linux/amd64, linux/arm64" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Pull Command" >> $GITHUB_STEP_SUMMARY | |
| echo '```bash' >> $GITHUB_STEP_SUMMARY | |
| echo "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # Create GitHub Release | |
| github-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate release notes | |
| id: release-notes | |
| run: | | |
| cat << 'EOF' > release-notes.md | |
| ## Node Doctor ${{ github.ref_name }} | |
| Kubernetes node health monitoring and auto-remediation DaemonSet. | |
| ### 🚀 Quick Start | |
| **Docker (Recommended):** | |
| ```bash | |
| docker pull supporttools/node-doctor:${{ github.ref_name }} | |
| ``` | |
| **Helm Chart:** | |
| ```bash | |
| helm repo add supporttools https://charts.support.tools | |
| helm repo update | |
| helm install node-doctor supporttools/node-doctor \ | |
| --namespace node-doctor \ | |
| --create-namespace | |
| ``` | |
| **Kubernetes Manifests:** | |
| ```bash | |
| kubectl apply -f https://raw.githubusercontent.com/supporttools/node-doctor/${{ github.ref_name }}/deployment/rbac.yaml | |
| kubectl apply -f https://raw.githubusercontent.com/supporttools/node-doctor/${{ github.ref_name }}/deployment/daemonset.yaml | |
| ``` | |
| ### 📦 Available Artifacts | |
| - **Docker Images:** `supporttools/node-doctor:${{ github.ref_name }}` (linux/amd64, linux/arm64) | |
| - **Helm Chart:** Available at https://charts.support.tools | |
| ### 📚 Documentation | |
| - [Deployment Guide](https://github.com/supporttools/node-doctor/blob/main/docs/deployment.md) | |
| - [Configuration Reference](https://github.com/supporttools/node-doctor/blob/main/docs/configuration.md) | |
| - [Monitor Specifications](https://github.com/supporttools/node-doctor/blob/main/docs/monitors.md) | |
| ### 🐛 Reporting Issues | |
| Found a bug? [Open an issue](https://github.com/supporttools/node-doctor/issues/new) | |
| EOF | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: release-notes.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }} | |
| files: | | |
| deployment/rbac.yaml | |
| deployment/daemonset.yaml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Helm Chart Publishing | |
| helm-publish: | |
| name: Publish Helm Chart | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| outputs: | |
| chart-version: ${{ steps.get-chart-version.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install envsubst | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gettext-base | |
| - name: Set up Helm | |
| uses: azure/[email protected] | |
| - name: Determine Chart Version | |
| id: get-chart-version | |
| run: | | |
| # Remove 'v' prefix for Helm chart version | |
| VERSION="${{ github.ref_name }}" | |
| VERSION="${VERSION#v}" | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Prepare Helm chart files | |
| run: | | |
| rm -f helm/node-doctor/Chart.yaml helm/node-doctor/values.yaml | |
| export CHART_VERSION="${{ steps.get-chart-version.outputs.version }}" | |
| export APP_VERSION="${{ github.ref_name }}" | |
| export IMAGE_TAG="${{ github.ref_name }}" | |
| envsubst < helm/node-doctor/Chart.yaml.template > helm/node-doctor/Chart.yaml | |
| envsubst < helm/node-doctor/values.yaml.template > helm/node-doctor/values.yaml | |
| echo "=== Chart.yaml ===" | |
| cat helm/node-doctor/Chart.yaml | |
| - name: Helm Lint | |
| run: helm lint helm/node-doctor/ | |
| - name: Package Helm chart | |
| run: | | |
| mkdir -p helm/repo | |
| helm package helm/node-doctor --destination helm/repo | |
| ls -la helm/repo/ | |
| - name: Checkout helm-chart repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: SupportTools/helm-chart | |
| path: helm-chart | |
| token: ${{ secrets.BOT_TOKEN }} | |
| - name: Configure Git | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "GitHub Action" | |
| - name: Update Helm repository | |
| run: | | |
| cp helm/repo/node-doctor-*.tgz helm-chart/ | |
| cd helm-chart | |
| helm repo index . --url https://charts.support.tools/ | |
| git add . | |
| git commit -m "Update Node Doctor Helm chart ${{ steps.get-chart-version.outputs.version }}" | |
| git push | |
| - name: Verify Chart Availability | |
| run: | | |
| helm repo add charts https://charts.support.tools/ | |
| MAX_TRIES=30 | |
| SLEEP_TIME=10 | |
| COUNTER=0 | |
| CHART_VERSION="${{ steps.get-chart-version.outputs.version }}" | |
| while [ $COUNTER -lt $MAX_TRIES ]; do | |
| helm repo update | |
| if helm search repo charts/node-doctor --version $CHART_VERSION | grep -q $CHART_VERSION; then | |
| echo "✅ Chart node-doctor version $CHART_VERSION found in repository" | |
| exit 0 | |
| fi | |
| echo "Waiting for chart to become available... (Attempt $((COUNTER+1))/$MAX_TRIES)" | |
| sleep $SLEEP_TIME | |
| let COUNTER=COUNTER+1 | |
| done | |
| echo "❌ Chart did not become available within the timeout period" | |
| exit 1 | |
| - name: Add Helm chart to release summary | |
| run: | | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### 📦 Helm Chart" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Chart Version:** ${{ steps.get-chart-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Repository:** https://charts.support.tools/" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Install with:" >> $GITHUB_STEP_SUMMARY | |
| echo '```bash' >> $GITHUB_STEP_SUMMARY | |
| echo "helm repo add supporttools https://charts.support.tools" >> $GITHUB_STEP_SUMMARY | |
| echo "helm repo update" >> $GITHUB_STEP_SUMMARY | |
| echo "helm install node-doctor supporttools/node-doctor --namespace node-doctor --create-namespace" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # Summary job | |
| release-complete: | |
| name: Release Complete | |
| runs-on: ubuntu-latest | |
| needs: [docker, github-release, helm-publish] | |
| if: always() | |
| steps: | |
| - name: Check release status | |
| run: | | |
| if [[ "${{ needs.docker.result }}" != "success" ]]; then | |
| echo "❌ Docker build job failed" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.github-release.result }}" != "success" ]]; then | |
| echo "❌ GitHub release job failed" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.helm-publish.result }}" != "success" ]]; then | |
| echo "❌ Helm publish job failed" | |
| exit 1 | |
| fi | |
| echo "✅ Release ${{ github.ref_name }} completed successfully!" | |
| echo "" | |
| echo "Next steps:" | |
| echo "1. Verify release: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}" | |
| echo "2. Test Docker image: docker pull supporttools/node-doctor:${{ github.ref_name }}" | |
| echo "3. Test Helm chart: helm install node-doctor supporttools/node-doctor" | |
| echo "4. Update documentation if needed" | |
| echo "5. Announce release to users" |