diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index fefb5a7..94e3e62 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -23,109 +23,43 @@ permissions: jobs: build: - name: ๐Ÿ› ๏ธ Build - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-build strategy: matrix: configuration: [Debug, Release] - framework: [net9.0,net8.0,netstandard2.0] - outputs: - version: ${{ steps.minver-calculate.outputs.version }} - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Install MinVer - uses: codebeltnet/dotnet-tool-install-minver@v1 - - - id: minver-calculate - name: Calculate Version - uses: codebeltnet/minver-calculate@v2 - - - name: Download xunit.snk file - uses: codebeltnet/gcp-download-file@v1 - with: - serviceAccountKey: ${{ secrets.GCP_TOKEN }} - bucketName: ${{ secrets.GCP_BUCKETNAME }} - objectName: xunit.snk - - - name: Set environment variable for projects - run: | - if [ "${{ matrix.framework }}" == "netstandard2.0" ]; then - projects=( - "src/**/Codebelt.Extensions.Xunit.csproj" - "src/**/Codebelt.Extensions.Xunit.Hosting.csproj" - ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV - else - echo "PROJECTS=src/**/*.csproj" >> $GITHUB_ENV - fi - shell: bash - - - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - - - name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) - uses: codebeltnet/dotnet-build@v2 - with: - projects: ${{ env.PROJECTS }} - configuration: ${{ matrix.configuration }} - framework: ${{ matrix.framework }} + uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} + strong-name-key-filename: xunit.snk + secrets: + GCP_TOKEN: ${{ secrets.GCP_TOKEN }} + GCP_BUCKETNAME: ${{ secrets.GCP_BUCKETNAME }} pack: - name: ๐Ÿ“ฆ Pack - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-pack + needs: [build] strategy: matrix: configuration: [Debug, Release] - needs: [build] - steps: - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Pack for ${{ matrix.configuration }} - uses: codebeltnet/dotnet-pack@v2 - with: - configuration: ${{ matrix.configuration }} - uploadPackedArtifact: true - version: ${{ needs.build.outputs.version }} + uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} + upload-packed-artifact: true + version: ${{ needs.build.outputs.version }} test: - name: ๐Ÿงช Test + name: call-test needs: [build] strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022] + os: [ubuntu-24.04, windows-2022] configuration: [Debug, Release] - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Install .NET Tool - Report Generator - uses: codebeltnet/dotnet-tool-install-reportgenerator@v1 - - - name: Test with ${{ matrix.configuration }} build - uses: codebeltnet/dotnet-test@v3 - with: - configuration: ${{ matrix.configuration }} - buildSwitches: -p:SkipSignAssembly=true + uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} + runs-on: ${{ matrix.os }} + build-switches: -p:SkipSignAssembly=true sonarcloud: name: call-sonarcloud @@ -154,16 +88,15 @@ jobs: deploy: if: github.event_name != 'pull_request' - name: ๐Ÿš€ Deploy v${{ needs.build.outputs.version }} - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-nuget needs: [build, pack, test, sonarcloud, codecov, codeql] - environment: Production + uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v1 + with: + version: ${{ needs.build.outputs.version }} + environment: Production + configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} permissions: contents: write packages: write - steps: - - uses: codebeltnet/nuget-push@v1 - with: - token: ${{ secrets.NUGET_TOKEN }} - configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} + secrets: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}