|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + push: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | + workflow_call: |
| 10 | + outputs: |
| 11 | + version: |
| 12 | + value: ${{ jobs.build.outputs.version }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + outputs: |
| 19 | + version: ${{ steps.version.outputs.version }} |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + fetch-depth: 0 |
| 26 | + |
| 27 | + - name: Install .NET 8 |
| 28 | + uses: actions/setup-dotnet@v4 |
| 29 | + with: |
| 30 | + dotnet-version: 8.0.x |
| 31 | + |
| 32 | + - name: Get next version |
| 33 | + id: version |
| 34 | + uses: reecetech/version-increment@2023.10.2 |
| 35 | + |
| 36 | + - name: Build |
| 37 | + run: | |
| 38 | + dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} |
| 39 | + |
| 40 | + - name: Upload PackScan.PackagesProvider.Abstractions |
| 41 | + uses: actions/upload-artifact@v4.3.1 |
| 42 | + with: |
| 43 | + name: PackScan.PackagesProvider.Abstractions.${{ steps.version.outputs.version }}.nupkg |
| 44 | + path: artifacts/PackScan.PackagesProvider.Abstractions.${{ steps.version.outputs.version }}.nupkg |
| 45 | + if-no-files-found: error |
| 46 | + |
| 47 | + - name: Upload PackScan.Analyzer |
| 48 | + uses: actions/upload-artifact@v4.3.1 |
| 49 | + with: |
| 50 | + name: PackScan.Analyzer.${{ steps.version.outputs.version }}.nupkg |
| 51 | + path: artifacts/PackScan.Analyzer.${{ steps.version.outputs.version }}.nupkg |
| 52 | + if-no-files-found: error |
| 53 | + |
| 54 | + - name: Upload PackScan.Defaults |
| 55 | + uses: actions/upload-artifact@v4.3.1 |
| 56 | + with: |
| 57 | + name: PackScan.Defaults.${{ steps.version.outputs.version }}.nupkg |
| 58 | + path: artifacts/PackScan.Defaults.${{ steps.version.outputs.version }}.nupkg |
| 59 | + if-no-files-found: error |
| 60 | + |
| 61 | + - name: Upload PackScan.Tool |
| 62 | + uses: actions/upload-artifact@v4.3.1 |
| 63 | + with: |
| 64 | + name: PackScan.Tool.${{ steps.version.outputs.version }}.nupkg |
| 65 | + path: artifacts/PackScan.Tool.${{ steps.version.outputs.version }}.nupkg |
| 66 | + if-no-files-found: error |
| 67 | + |
| 68 | + test: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + include: |
| 74 | + - dotnet-version: 3.1.x |
| 75 | + dotnet-framework: netcoreapp3.1 |
| 76 | + |
| 77 | + - dotnet-version: 5.0.x |
| 78 | + dotnet-framework: net5.0 |
| 79 | + |
| 80 | + - dotnet-version: 6.0.x |
| 81 | + dotnet-framework: net6.0 |
| 82 | + |
| 83 | + - dotnet-version: 7.0.x |
| 84 | + dotnet-framework: net7.0 |
| 85 | + |
| 86 | + - dotnet-version: 8.0.x |
| 87 | + dotnet-framework: net8.0 |
| 88 | + |
| 89 | + steps: |
| 90 | + - name: Checkout |
| 91 | + uses: actions/checkout@v4 |
| 92 | + |
| 93 | + - name: Install .NET |
| 94 | + uses: actions/setup-dotnet@v4 |
| 95 | + with: |
| 96 | + dotnet-version: ${{ matrix.dotnet-version }} |
| 97 | + |
| 98 | + - name: Run Tests |
| 99 | + run: | |
| 100 | + dotnet test -f ${{ matrix.dotnet-framework }} -c Release |
0 commit comments