|
1 | | -name: Build |
2 | | - |
3 | | -on: |
4 | | - workflow_call: |
5 | | - inputs: |
6 | | - version: |
7 | | - required: true |
8 | | - type: string |
9 | | - no-suffix: |
10 | | - type: boolean |
11 | | - default: false |
12 | | - |
13 | | - |
14 | | -defaults: |
15 | | - run: |
16 | | - shell: pwsh |
17 | | - |
18 | | -env: |
19 | | - DOTNET_TELEMETRY_OPTOUT: true |
20 | | - DOTNET_NOLOGO: true |
21 | | - NUGET_PACKAGES: ${{github.workspace}}/artifacts/pkg |
22 | | - |
23 | | -jobs: |
24 | | - build: |
25 | | - runs-on: ubuntu-latest |
26 | | - name: Build |
27 | | - env: |
28 | | - VersionSuffix: ${{ !inputs.no-suffix && inputs.version }} |
29 | | - DoNotAddSuffix: ${{ inputs.no-suffix && '1' }} |
30 | | - ContinuousIntegrationBuild: true |
31 | | - steps: |
32 | | - - name: Configure git |
33 | | - run: | |
34 | | - git config --global core.autocrlf input |
35 | | -
|
36 | | - - name: Checkout |
37 | | - uses: actions/checkout@v4 |
38 | | - with: |
39 | | - lfs: true |
40 | | - submodules: recursive |
41 | | - |
42 | | - # TODO: maybe we can eventually use package locks for package caching? |
43 | | - |
44 | | - - name: Install .NET SDK |
45 | | - uses: nike4613/install-dotnet@533307d1c90c37993c8ef1397388bc9783e7b87c |
46 | | - with: |
47 | | - global-json: global.json |
48 | | - |
49 | | - # NOTE: manual package caching |
50 | | - - name: Cache restored NuGet packages |
51 | | - uses: actions/cache@v4 |
52 | | - with: |
53 | | - path: ${{ env.NUGET_PACKAGES }} |
54 | | - key: ${{ runner.os }}-nuget-v1-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets', 'nuget.config', 'global.json') }} |
55 | | - restore-keys: ${{ runner.os }}-nuget-v1- |
56 | | - |
57 | | - - name: Restore |
58 | | - run: dotnet restore -bl:restore.binlog -noAutoRsp |
59 | | - |
60 | | - - name: Build |
61 | | - run: dotnet build --no-restore -c Release -bl:build.binlog -clp:NoSummary -noAutoRsp |
62 | | - |
63 | | - - name: Pack |
64 | | - run: dotnet pack --no-restore -c Release -bl:pack.binlog -clp:NoSummary -noAutoRsp |
65 | | - |
66 | | - |
67 | | - # TODO: if/when we add tests, run them here and hook up test reporting |
68 | | - #- name: Run auxiliary tests |
69 | | - # run: dotnet test --no-build -c Release -l:"trx;LogFileName=$($env:LOG_FILE_NAME)" |
70 | | - # |
71 | | - #- name: Upload test results |
72 | | - # uses: actions/upload-artifact@v4 |
73 | | - # if: ${{ always() }} |
74 | | - # with: |
75 | | - # name: test-results aux ${{ runner.os }} |
76 | | - # retention-days: 1 |
77 | | - # path: 'TestResults/*.trx' |
78 | | - # if-no-files-found: ignore |
79 | | - |
80 | | - - name: Upload binlogs |
81 | | - uses: actions/upload-artifact@v4 |
82 | | - if: ${{ always() }} |
83 | | - with: |
84 | | - name: binlogs-${{ runner.os }} |
85 | | - path: '*.binlog' |
86 | | - retention-days: 7 |
87 | | - |
88 | | - - name: Archive packages |
89 | | - uses: actions/upload-artifact@v4 |
90 | | - with: |
91 | | - name: packages |
92 | | - path: artifacts/package/release/*.nupkg |
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + no-suffix: |
| 10 | + type: boolean |
| 11 | + default: false |
| 12 | + |
| 13 | +defaults: |
| 14 | + run: |
| 15 | + shell: pwsh |
| 16 | + |
| 17 | +env: |
| 18 | + DOTNET_TELEMETRY_OPTOUT: true |
| 19 | + DOTNET_NOLOGO: true |
| 20 | + NUGET_PACKAGES: ${{github.workspace}}/artifacts/pkg |
| 21 | + |
| 22 | +jobs: |
| 23 | + build: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + name: Build |
| 26 | + env: |
| 27 | + VersionSuffix: ${{ !inputs.no-suffix && inputs.version }} |
| 28 | + DoNotAddSuffix: ${{ inputs.no-suffix && '1' }} |
| 29 | + ContinuousIntegrationBuild: true |
| 30 | + steps: |
| 31 | + - name: Configure git |
| 32 | + run: | |
| 33 | + git config --global core.autocrlf input |
| 34 | +
|
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v6 |
| 37 | + with: |
| 38 | + lfs: true |
| 39 | + submodules: recursive |
| 40 | + |
| 41 | + # TODO: maybe we can eventually use package locks for package caching? |
| 42 | + |
| 43 | + - name: Install .NET SDK |
| 44 | + uses: nike4613/install-dotnet@533307d1c90c37993c8ef1397388bc9783e7b87c |
| 45 | + with: |
| 46 | + global-json: global.json |
| 47 | + |
| 48 | + # NOTE: manual package caching |
| 49 | + - name: Cache restored NuGet packages |
| 50 | + uses: actions/cache@v5 |
| 51 | + with: |
| 52 | + path: ${{ env.NUGET_PACKAGES }} |
| 53 | + key: ${{ runner.os }}-nuget-v1-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets', 'nuget.config', 'global.json') }} |
| 54 | + restore-keys: ${{ runner.os }}-nuget-v1- |
| 55 | + |
| 56 | + - name: Restore |
| 57 | + run: dotnet restore -bl:restore.binlog -noAutoRsp |
| 58 | + |
| 59 | + - name: Build |
| 60 | + run: dotnet build --no-restore -c Release -bl:build.binlog -clp:NoSummary -noAutoRsp |
| 61 | + |
| 62 | + - name: Pack |
| 63 | + run: dotnet pack --no-restore -c Release -bl:pack.binlog -clp:NoSummary -noAutoRsp |
| 64 | + |
| 65 | + # TODO: if/when we add tests, run them here and hook up test reporting |
| 66 | + #- name: Run auxiliary tests |
| 67 | + # run: dotnet test --no-build -c Release -l:"trx;LogFileName=$($env:LOG_FILE_NAME)" |
| 68 | + # |
| 69 | + #- name: Upload test results |
| 70 | + # uses: actions/upload-artifact@v4 |
| 71 | + # if: ${{ always() }} |
| 72 | + # with: |
| 73 | + # name: test-results aux ${{ runner.os }} |
| 74 | + # retention-days: 1 |
| 75 | + # path: 'TestResults/*.trx' |
| 76 | + # if-no-files-found: ignore |
| 77 | + |
| 78 | + - name: Upload binlogs |
| 79 | + uses: actions/upload-artifact@v6 |
| 80 | + if: ${{ always() }} |
| 81 | + with: |
| 82 | + name: binlogs-${{ runner.os }} |
| 83 | + path: "*.binlog" |
| 84 | + retention-days: 7 |
| 85 | + |
| 86 | + - name: Archive packages |
| 87 | + uses: actions/upload-artifact@v6 |
| 88 | + with: |
| 89 | + name: packages |
| 90 | + path: artifacts/package/release/*.nupkg |
0 commit comments