|
1 | 1 | on: |
2 | | - push: |
| 2 | + push: |
3 | 3 |
|
4 | 4 | env: |
5 | | - DOTNET_VERSION: "7.0.x" # The .NET SDK version to use |
6 | | - SOLUTION_DIR: "LocalNetAppChat" |
7 | | - PROJECT: "./LocalNetAppChat.Server/LocalNetAppChat.Server.csproj" |
8 | | - RELEASEPREFIX: "LocalNetAppChat" |
| 5 | + DOTNET_VERSION: "7.0.x" # The .NET SDK version to use |
| 6 | + SOLUTION_DIR: "LocalNetAppChat" |
| 7 | + PROJECT: "./LocalNetAppChat.Server/LocalNetAppChat.Server.csproj" |
| 8 | + RELEASEPREFIX: "LocalNetAppChat" |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - build: |
12 | | - name: build-${{matrix.os}} |
13 | | - runs-on: ${{ matrix.os }} |
14 | | - strategy: |
15 | | - matrix: |
16 | | - os: [ubuntu-latest, windows-latest] |
17 | | - include: |
18 | | - - os: ubuntu-latest |
19 | | - RUNTIMEID: linux-x64 |
20 | | - OUTPUTDIR: lnac-server-linux-x64 |
21 | | - |
22 | | - - os: windows-latest |
23 | | - RUNTIMEID: win-x64 |
24 | | - OUTPUTDIR: lnac-server-win-x64 |
25 | | - |
26 | | - steps: |
27 | | - - uses: actions/checkout@v2 |
28 | | - - name: Setup .NET Core |
29 | | - uses: actions/setup-dotnet@v1 |
30 | | - with: |
31 | | - dotnet-version: ${{ env.DOTNET_VERSION }} |
32 | | - |
33 | | - - name: Install dependencies |
34 | | - run: dotnet restore |
35 | | - working-directory: Source/${{ env.SOLUTION_DIR }} |
36 | | - |
37 | | - # - name: Set version number |
38 | | - # run: ./Set-Version-Number.ps1 "1.${{github.run_number}}" |
39 | | - # working-directory: Scripts |
40 | | - # shell: powershell |
41 | | - |
42 | | - - name: Build |
43 | | - run: dotnet build --configuration Release --no-restore |
44 | | - working-directory: Source/${{ env.SOLUTION_DIR }} |
45 | | - |
46 | | - # - name: Test + Cover |
47 | | - # run: ./update-coverage.sh |
48 | | - |
49 | | - - name: Publish |
50 | | - run: dotnet publish ${{ env.PROJECT }} -c Release -o ${{matrix.OUTPUTDIR}} -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -r ${{matrix.RUNTIMEID}} |
51 | | - working-directory: Source/${{ env.SOLUTION_DIR }} |
52 | | - |
53 | | - - uses: vimtor/action-zip@v1 |
54 | | - with: |
55 | | - files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/ |
56 | | - dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip |
57 | | - |
58 | | - - name: Release |
59 | | - uses: softprops/action-gh-release@v1 |
60 | | - if: startsWith(github.ref, 'refs/tags/') |
61 | | - with: |
62 | | - files: | |
63 | | - ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip |
| 11 | + build: |
| 12 | + name: build-${{matrix.os}} |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, windows-latest] |
| 17 | + include: |
| 18 | + - os: ubuntu-latest |
| 19 | + RUNTIMEID: linux-x64 |
| 20 | + OUTPUTDIR: lnac-server-linux-x64 |
| 21 | + |
| 22 | + - os: windows-latest |
| 23 | + RUNTIMEID: win-x64 |
| 24 | + OUTPUTDIR: lnac-server-win-x64 |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - name: Setup .NET Core |
| 29 | + uses: actions/setup-dotnet@v1 |
| 30 | + with: |
| 31 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 32 | + |
| 33 | + - name: Install dependencies |
| 34 | + run: dotnet restore |
| 35 | + working-directory: Source/${{ env.SOLUTION_DIR }} |
| 36 | + |
| 37 | + # - name: Set version number |
| 38 | + # run: ./Set-Version-Number.ps1 "1.${{github.run_number}}" |
| 39 | + # working-directory: Scripts |
| 40 | + # shell: powershell |
| 41 | + |
| 42 | + - name: Build |
| 43 | + run: dotnet build --configuration Release --no-restore |
| 44 | + working-directory: Source/${{ env.SOLUTION_DIR }} |
| 45 | + |
| 46 | + - name: Test + Cover |
| 47 | + run: dotnet test |
| 48 | + working-directory: Source/${{ env.SOLUTION_DIR }} |
| 49 | + |
| 50 | + - name: Coveralls |
| 51 | + uses: coverallsapp/github-action@master |
| 52 | + with: |
| 53 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + path-to-lcov: Source/${{ env.SOLUTION_DIR }}/LocalNetAppChat.Server.Domain.Tests/coverage.info |
| 55 | + |
| 56 | + - name: Publish |
| 57 | + run: dotnet publish ${{ env.PROJECT }} -c Release -o ${{matrix.OUTPUTDIR}} -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -r ${{matrix.RUNTIMEID}} |
| 58 | + working-directory: Source/${{ env.SOLUTION_DIR }} |
| 59 | + |
| 60 | + - uses: vimtor/action-zip@v1 |
| 61 | + with: |
| 62 | + files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/ |
| 63 | + dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip |
| 64 | + |
| 65 | + - name: Release |
| 66 | + uses: softprops/action-gh-release@v1 |
| 67 | + if: startsWith(github.ref, 'refs/tags/') |
| 68 | + with: |
| 69 | + files: | |
| 70 | + ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip |
0 commit comments