fix(depdencies): fix dependency issue #328
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: Pull Request Go Releaser | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| checks: write | |
| jobs: | |
| validate-chart-version: | |
| runs-on: ubuntu-22.04 | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if chart files changed | |
| id: check-chart-changes | |
| run: | | |
| git fetch origin main:main | |
| if git diff --name-only origin/main...HEAD | grep -q '^chart/'; then | |
| echo "chart-changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "chart-changed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Get current chart version | |
| id: current-version | |
| if: steps.check-chart-changes.outputs.chart-changed == 'true' | |
| run: | | |
| current_version=$(grep '^version:' chart/cert-manager-webhook-ionos-cloud/Chart.yaml | awk '{print $2}') | |
| echo "current-version=$current_version" >> "$GITHUB_OUTPUT" | |
| - name: Get main branch chart version | |
| id: main-version | |
| if: steps.check-chart-changes.outputs.chart-changed == 'true' | |
| run: | | |
| git checkout main | |
| main_version=$(grep '^version:' chart/cert-manager-webhook-ionos-cloud/Chart.yaml | awk '{print $2}') | |
| echo "main-version=$main_version" >> "$GITHUB_OUTPUT" | |
| git checkout - | |
| - name: Validate version bump | |
| if: steps.check-chart-changes.outputs.chart-changed == 'true' | |
| run: | | |
| current="${{ steps.current-version.outputs.current-version }}" | |
| main="${{ steps.main-version.outputs.main-version }}" | |
| echo "Current chart version: $current" | |
| echo "Main branch chart version: $main" | |
| if [ "$current" = "$main" ]; then | |
| echo "❌ Chart files were modified but chart version was not bumped!" | |
| echo "Please increment the version in chart/cert-manager-webhook-ionos-cloud/Chart.yaml" | |
| echo "Current version: $current" | |
| exit 1 | |
| else | |
| echo "✅ Chart version was properly bumped from $main to $current" | |
| fi | |
| snapshot-release: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Git Fetch | |
| run: git fetch --force --tags | |
| - name: Get latest non-chart tag | |
| id: get-latest-release-tag | |
| run: | | |
| latest_release_tag="$(git tag --list --sort='-version:refname' | grep -v 'chart' | head -n 1)" | |
| echo "latest-release-tag=$latest_release_tag" >> "$GITHUB_OUTPUT" | |
| echo "Using release tag: $latest_release_tag" | |
| - name: Setup go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Run Unit Tests | |
| run: make unit-test | |
| - name: Test Report | |
| uses: dorny/test-reporter@v3 | |
| if: success() || failure() | |
| with: | |
| name: Unit Test Results | |
| path: ./out/report.xml | |
| reporter: java-junit | |
| fail-on-error: 'true' | |
| - name: Upload Reports | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: unit-test-reports | |
| path: ./out/report.xml | |
| - name: Run conformance tests | |
| env: | |
| TEST_ZONE_NAME: ${{ secrets.TEST_ZONE_NAME }} | |
| IONOS_TOKEN: ${{ secrets.IONOS_TOKEN }} | |
| run: | | |
| make conformance-test | |
| - name: Set Up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Go Snapshot Release | |
| if: github.event_name == 'pull_request' | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: v2.9.0 | |
| args: release --snapshot --clean --skip=publish | |
| env: | |
| GORELEASER_CURRENT_TAG: ${{ steps.get-latest-release-tag.outputs.latest-release-tag }} |