ci(pipeline): enhance output variables for versioning #347
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_publish: | |
| description: 'Forces a publish even if no changes are detected' | |
| required: true | |
| default: 'false' | |
| concurrency: | |
| group: pipeline-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| 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 }} | |
| requiresBuild: ${{ steps.requires_build.outputs.result }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| 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: '5.x' | |
| preferLatestVersion: true | |
| - name: gitversion - execute | |
| id: gitversion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| useConfigFile: true | |
| configFilePath: GitVersion.yaml | |
| - name: tools - detect changes | |
| id: pathsFilter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| base: ${{ github.ref }} | |
| filters: | | |
| src: | |
| - 'src/**' | |
| - name: evaluate - requires_build | |
| id: requires_build | |
| run: | | |
| if [ "${{ steps.pathsFilter.outputs.src }}" = "true" ] || \ | |
| [ "${{ github.event.inputs.force_build }}" = "true" ] || \ | |
| [ "${{ github.event.inputs.force_publish }}" = "true" ]; then | |
| result=true | |
| else | |
| result=false | |
| fi | |
| echo "result=$result" >> $GITHUB_OUTPUT | |
| build: | |
| name: build | |
| if: ${{ needs.discovery.outputs.requiresBuild == 'true' }} | |
| needs: [discovery] | |
| runs-on: ubuntu-latest | |
| # env: | |
| # operator_credentials: ${{ needs.discovery.outputs.operator_credentials }} | |
| # image_registry: ${{ needs.discovery.outputs.image_registry }} | |
| # build_push: ${{ needs.discovery.outputs.build_push }} | |
| # build_configuration: ${{ needs.discovery.outputs.build_configuration }} | |
| # SERVICE_NAME: ${{ matrix.service.name }} | |
| # SERVICE_DIR: ${{ matrix.service.dir }} | |
| # SOLUTION_FILE: ${{ matrix.service.solution }} | |
| # HELM_CHART: ${{ matrix.service.helmChart }} | |
| # HELM_CHART_DIR: ${{ matrix.service.helmChartDir }} | |
| # gitVersion_SemVer: ${{ needs.discovery.outputs.gitVersion_SemVer }} | |
| # gitVersion_AssemblySemFileVer: ${{ needs.discovery.outputs.gitVersion_AssemblySemFileVer }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |