|
| 1 | +name: CI_build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + |
| 8 | + runs-on: windows-latest |
| 9 | + env: |
| 10 | + Solution: CompressedFileViewer.sln |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + build_configuration: [Release, Debug] |
| 15 | + build_platform: [x64, x86] |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repo |
| 19 | + uses: actions/checkout@v6 |
| 20 | + |
| 21 | + - name: Add msbuild to PATH |
| 22 | + uses: microsoft/setup-msbuild@v3 |
| 23 | + |
| 24 | + - name: Setup NuGet |
| 25 | + uses: nuget/setup-nuget@v4 |
| 26 | + |
| 27 | + - name: Setup dotnet for ${{ matrix.build_platform }} |
| 28 | + uses: actions/setup-dotnet@v5 |
| 29 | + with: |
| 30 | + dotnet-version: | |
| 31 | + 8.0.x |
| 32 | + architecture: ${{ matrix.build_platform }} |
| 33 | + |
| 34 | + - name: Nuget restore solution |
| 35 | + working-directory: . |
| 36 | + run: nuget restore $env:Solution |
| 37 | + |
| 38 | + - name: Dotnet restore dependencies |
| 39 | + run: dotnet restore $env:Solution --arch ${{ matrix.build_platform }} |
| 40 | + |
| 41 | + - name: MSBuild of plugin dll |
| 42 | + run: msbuild $env:Solution /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" |
| 43 | + |
| 44 | + - uses: olegtarasov/get-tag@v2.1.4 |
| 45 | + id: tagName |
| 46 | + |
| 47 | + - name: Archive artifacts for ${{ matrix.build_platform }} |
| 48 | + if: matrix.build_configuration == 'Release' |
| 49 | + uses: actions/upload-artifact@v7 |
| 50 | + with: |
| 51 | + name: CompressedFileViewer_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip |
| 52 | + path: CompressedFileViewer\publish\CompressedFileViewer${{ matrix.build_platform }}.zip |
| 53 | + |
| 54 | + - name: Create release on tagging |
| 55 | + uses: softprops/action-gh-release@v3 |
| 56 | + if: startsWith(github.ref, 'refs/tags/') |
| 57 | + with: |
| 58 | + files: CompressedFileViewer_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip |
| 59 | + |
0 commit comments