chore(deps): bump actions/checkout in the all-dependencies group #492
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: Pipeline | |
| on: | |
| push: | |
| branches: | |
| - "**" # Matches all branches | |
| pull_request: | |
| branches: | |
| - "**" # Matches all branches | |
| workflow_dispatch: | |
| inputs: | |
| force_build: | |
| description: "Forces a build even if no changes are detected" | |
| required: true | |
| default: "false" | |
| force_release: | |
| description: "Forces a release even if no changes are detected" | |
| required: true | |
| default: "false" | |
| concurrency: | |
| group: pipeline-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| helm_chart: "reflector" | |
| helm_chart_dir: "src/helm/reflector" | |
| helm_chart_repository: "ghcr.io/emberstack/helm-charts" | |
| helm_chart_repository_protocol: "oci://" | |
| container_image: "kubernetes-reflector" | |
| container_image_build_context: "." | |
| container_image_build_platforms: "linux/amd64,linux/arm/v7,linux/arm64" | |
| container_image_build_dockerfile: "src/ES.Kubernetes.Reflector/Dockerfile" | |
| container_image_repository_dockerhub: "emberstack" | |
| container_image_repository_ghcr: "ghcr.io/emberstack" | |
| jobs: | |
| discovery: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| pathsFilter_src: ${{ steps.pathsFilter.outputs.src }} | |
| gitVersion_SemVer: ${{ steps.gitversion.outputs.GitVersion_SemVer }} | |
| gitVersion_AssemblySemFileVer: ${{ steps.gitversion.outputs.GitVersion_AssemblySemFileVer }} | |
| build: ${{ steps.evaluate_build.outputs.result }} | |
| build_push: ${{ steps.evaluate_build_push.outputs.result }} | |
| build_configuration: ${{ steps.evaluate_build_configuration.outputs.result }} | |
| release: ${{ steps.evaluate_release.outputs.result }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: tools - dotnet - install | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.x" | |
| - name: tools - gitversion - install | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| versionSpec: "6.x" | |
| preferLatestVersion: true | |
| - name: gitversion - execute | |
| id: gitversion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| configFilePath: GitVersion.yaml | |
| - name: tools - detect changes | |
| id: pathsFilter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| base: ${{ github.ref }} | |
| filters: | | |
| src: | |
| - '*.sln' | |
| - '*.slnx' | |
| - '*.props' | |
| - 'src/**' | |
| build: | |
| - '*.sln' | |
| - '*.slnx' | |
| - '*.props' | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'playground/**' | |
| - name: evaluate - build | |
| id: evaluate_build | |
| env: | |
| RESULT: ${{ steps.pathsFilter.outputs.build == 'true' || github.event.inputs.force_build == 'true' || github.event.inputs.force_release == 'true' }} | |
| run: echo "result=$RESULT" >> $GITHUB_OUTPUT | |
| - name: evaluate - build_push | |
| id: evaluate_build_push | |
| env: | |
| RESULT: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && (steps.pathsFilter.outputs.src == 'true' || github.event.inputs.force_build == 'true') }} | |
| run: echo "result=$RESULT" >> $GITHUB_OUTPUT | |
| - name: evaluate - build_configuration | |
| id: evaluate_build_configuration | |
| env: | |
| RESULT: ${{ github.ref == 'refs/heads/main' && 'Release' || 'Debug' }} | |
| run: echo "result=$RESULT" >> $GITHUB_OUTPUT | |
| - name: evaluate - release | |
| id: evaluate_release | |
| env: | |
| RESULT: ${{ github.ref == 'refs/heads/main' || github.event.inputs.force_release == 'true' }} | |
| run: echo "result=$RESULT" >> $GITHUB_OUTPUT | |
| build: | |
| name: build | |
| if: ${{ needs.discovery.outputs.build == 'true' }} | |
| needs: [discovery] | |
| runs-on: ubuntu-latest | |
| env: | |
| build: ${{ needs.discovery.outputs.build }} | |
| build_push: ${{ needs.discovery.outputs.build_push }} | |
| build_configuration: ${{ needs.discovery.outputs.build_configuration }} | |
| gitVersion_SemVer: ${{ needs.discovery.outputs.gitVersion_SemVer }} | |
| gitVersion_AssemblySemFileVer: ${{ needs.discovery.outputs.gitVersion_AssemblySemFileVer }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| - name: artifacts - prepare directories | |
| run: | | |
| mkdir -p .artifacts/helm | |
| mkdir -p .artifacts/kubectl | |
| - name: tools - dotnet - install | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.x" | |
| - name: dotnet - restore | |
| run: dotnet restore | |
| - name: dotnet - build | |
| run: dotnet build --no-restore --configuration ${{ env.build_configuration }} /p:Version=${{ env.gitVersion_SemVer }} /p:AssemblyVersion=${{env.gitVersion_AssemblySemFileVer}} /p:NuGetVersion=${{env.gitVersion_SemVer}} | |
| - name: dotnet - test | |
| run: dotnet test --no-build --configuration ${{ env.build_configuration }} --verbosity normal | |
| - name: tests - report | |
| uses: dorny/test-reporter@v2 | |
| if: ${{ github.event.pull_request.head.repo.fork == false }} | |
| with: | |
| name: Test Results | |
| path: .artifacts/TestResults/*.trx | |
| reporter: dotnet-trx | |
| fail-on-empty: "false" | |
| - name: tools - helm - install | |
| uses: azure/setup-helm@v4 | |
| - name: tools - helm - login - ghcr.io | |
| if: ${{ env.build_push == 'true' }} | |
| run: echo "${{ secrets.ES_GITHUB_PAT }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: tools - docker - login ghcr.io | |
| if: ${{ env.build_push == 'true' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.ES_GITHUB_PAT }} | |
| - name: tools - docker - login docker.io | |
| if: ${{ env.build_push == 'true' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.ES_DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.ES_DOCKERHUB_PAT }} | |
| - name: tools - docker - register QEMU | |
| run: | | |
| docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
| - name: tools - docker - setup buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver: docker-container # REQUIRED for multi-platform builds | |
| - name: helm - import README | |
| run: cp README.md ${{ env.helm_chart_dir }}/README.md | |
| - name: helm - package chart | |
| run: helm package --destination .artifacts/helm --version ${{ env.gitVersion_SemVer }} --app-version ${{ env.gitVersion_SemVer }} ${{ env.helm_chart_dir }} | |
| - name: helm - template chart | |
| run: helm template --namespace kube-system ${{ env.helm_chart }} .artifacts/helm/${{ env.helm_chart }}-${{ env.gitVersion_SemVer }}.tgz > .artifacts/kubectl/${{ env.helm_chart }}.yaml | |
| - name: docker - build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ${{ env.container_image_build_context }} | |
| file: ${{ env.container_image_build_dockerfile }} | |
| build-args: | | |
| BUILD_CONFIGURATION=${{ env.build_configuration }} | |
| push: ${{ env.build_push == 'true' }} | |
| provenance: false | |
| platforms: ${{ env.container_image_build_platforms }} | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.vendor=https://github.com/${{ github.repository_owner }} | |
| org.opencontainers.image.version=${{ env.gitVersion_SemVer }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| tags: | | |
| ${{ env.container_image_repository_dockerhub }}/${{ env.container_image }}:${{ env.gitVersion_SemVer }} | |
| ${{ env.container_image_repository_ghcr }}/${{ env.container_image }}:${{ env.gitVersion_SemVer }} | |
| - name: helm - push | |
| if: ${{ env.build_push == 'true' }} | |
| run: helm push .artifacts/helm/${{ env.helm_chart }}-${{ env.gitVersion_SemVer }}.tgz ${{ env.helm_chart_repository_protocol }}${{ env.helm_chart_repository }} | |
| - name: artifacts - helm - upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts-helm-${{env.gitVersion_SemVer}} | |
| path: .artifacts/helm | |
| - name: artifacts - kubectl - upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts-kubectl-${{env.gitVersion_SemVer}} | |
| path: .artifacts/kubectl | |
| release: | |
| name: release | |
| if: ${{ needs.discovery.outputs.release == 'true' && github.ref == 'refs/heads/main' }} | |
| needs: [discovery, build] | |
| runs-on: ubuntu-latest | |
| env: | |
| gitVersion_SemVer: ${{ needs.discovery.outputs.gitVersion_SemVer }} | |
| gitVersion_AssemblySemFileVer: ${{ needs.discovery.outputs.gitVersion_AssemblySemFileVer }} | |
| steps: | |
| - name: artifacts - helm - download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: artifacts-helm-${{env.gitVersion_SemVer}} | |
| path: .artifacts/helm | |
| - name: artifacts - kubectl - download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: artifacts-kubectl-${{env.gitVersion_SemVer}} | |
| path: .artifacts/kubectl | |
| - name: tools - helm - install | |
| uses: azure/setup-helm@v4 | |
| - name: tools - helm - login - ghcr.io | |
| run: echo "${{ secrets.ES_GITHUB_PAT }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: tools - oras - install | |
| uses: oras-project/setup-oras@v1 | |
| - name: tools - oras - login - ghcr.io | |
| run: echo "${{ secrets.ES_GITHUB_PAT }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: tools - docker - login ghcr.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.ES_GITHUB_PAT }} | |
| - name: tools - docker - login docker.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.ES_DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.ES_DOCKERHUB_PAT }} | |
| - name: tools - docker - setup buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: docker - tag and push - latest | |
| run: | | |
| docker buildx imagetools create \ | |
| --tag ${{ env.container_image_repository_dockerhub }}/${{ env.container_image }}:latest \ | |
| --tag ${{ env.container_image_repository_ghcr }}/${{ env.container_image }}:latest \ | |
| --tag ${{ env.container_image_repository_dockerhub }}/${{ env.container_image }}:${{ env.gitVersion_SemVer }} \ | |
| --tag ${{ env.container_image_repository_ghcr }}/${{ env.container_image }}:${{ env.gitVersion_SemVer }} \ | |
| ${{ env.container_image_repository_ghcr }}/${{ env.container_image }}:${{ env.gitVersion_SemVer }} | |
| - name: helm - push | |
| run: helm push .artifacts/helm/${{ env.helm_chart }}-${{ env.gitVersion_SemVer }}.tgz ${{ env.helm_chart_repository_protocol }}${{ env.helm_chart_repository }} | |
| - name: github - release - create | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| repository: ${{ github.repository }} | |
| name: v${{ env.gitVersion_SemVer }} | |
| tag_name: v${{ env.gitVersion_SemVer }} | |
| body: The release process is automated. | |
| generate_release_notes: true | |
| token: ${{ secrets.ES_GITHUB_PAT }} | |
| files: | | |
| .artifacts/kubectl/${{ env.helm_chart }}.yaml | |
| - name: github - repository-dispatch - release | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.ES_GITHUB_PAT }} | |
| repository: emberstack/helm-charts | |
| event-type: release | |
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |