|
1 | | -name: Build |
| 1 | +name: Build |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
17 | 17 | workflow_dispatch: |
18 | 18 |
|
19 | 19 | jobs: |
20 | | - build-on-windows: |
21 | | - runs-on: windows-latest |
| 20 | + build: |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + os: [windows-latest, linux-latest, macos-latest] |
| 24 | + |
| 25 | + runs-on: ${{ matrix.os }} |
22 | 26 |
|
23 | 27 | steps: |
24 | 28 | - uses: actions/checkout@v3 |
25 | 29 |
|
26 | 30 | - name: Setup .NET |
27 | 31 | uses: actions/setup-dotnet@v2 |
28 | 32 | with: |
29 | | - dotnet-version: "6.0.x" |
| 33 | + dotnet-version: | |
| 34 | + 6.0.x |
| 35 | + 7.0.x |
30 | 36 | include-prerelease: false |
31 | 37 |
|
32 | 38 | - name: Build |
33 | 39 | run: | |
34 | 40 | cd Common.BasicHelper |
35 | | - dotnet build -c Release |
36 | | -
|
37 | | - build-on-ubuntu: |
38 | | - runs-on: ubuntu-latest |
39 | | - |
40 | | - steps: |
41 | | - - uses: actions/checkout@v3 |
42 | 41 |
|
43 | | - - name: Setup .NET |
44 | | - uses: actions/setup-dotnet@v2 |
45 | | - with: |
46 | | - dotnet-version: "6.0.x" |
47 | | - include-prerelease: false |
| 42 | + dotnet build -c Release |
48 | 43 |
|
49 | | - - name: Build |
| 44 | + - name: Test |
50 | 45 | run: | |
51 | | - cd Common.BasicHelper |
52 | | - dotnet build -c Release |
| 46 | + cd Common.BasicHelper.Test |
| 47 | +
|
| 48 | + dotnet test -c Release |
53 | 49 |
|
54 | 50 | - name: Add to GitHub Repo |
| 51 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
55 | 52 | run: | |
56 | 53 | nuget sources add -name github -Source https://nuget.pkg.github.com/Crequency/index.json -Username Crequency -Password ${{ secrets.GitHubToken }} |
57 | 54 |
|
58 | 55 | - name: Install NuGet |
| 56 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
59 | 57 | uses: nuget/setup-nuget@v1 |
60 | 58 | with: |
61 | 59 | nuget-version: "6.x" |
62 | 60 |
|
63 | 61 | - name: Publish Package to GitHub and NuGet |
| 62 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
64 | 63 | run: | |
65 | 64 | nuget push ./Common.BasicHelper/bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol |
66 | 65 | nuget push ./Common.BasicHelper/bin/Release/*.nupkg -Source github -SkipDuplicate |
67 | | -
|
68 | | - build-on-macos: |
69 | | - runs-on: macos-latest |
70 | | - |
71 | | - steps: |
72 | | - - uses: actions/checkout@v3 |
73 | | - |
74 | | - - name: Setup .NET |
75 | | - uses: actions/setup-dotnet@v2 |
76 | | - with: |
77 | | - dotnet-version: "6.0.x" |
78 | | - include-prerelease: false |
79 | | - |
80 | | - - name: Build |
81 | | - run: | |
82 | | - cd Common.BasicHelper |
83 | | - dotnet build -c Release |
0 commit comments