|
5 | 5 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |
6 | 6 | DOTNET_ENVIRONMENT: github |
7 | 7 | ASPNETCORE_ENVIRONMENT: github |
8 | | - BUILD_PATH: '${{github.workspace}}/artifacts' |
| 8 | + BUILD_PATH: "${{github.workspace}}/artifacts" |
9 | 9 | COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
10 | 10 |
|
11 | 11 | on: |
|
14 | 14 | - master |
15 | 15 | - develop |
16 | 16 | tags: |
17 | | - - 'v*' |
| 17 | + - "v*" |
18 | 18 | pull_request: |
19 | 19 | branches: |
20 | 20 | - master |
21 | 21 | - develop |
22 | 22 |
|
23 | 23 | jobs: |
24 | | - |
25 | 24 | build: |
26 | 25 | runs-on: ubuntu-latest |
27 | 26 |
|
28 | 27 | services: |
29 | 28 | mongodb: |
30 | 29 | image: mongo:latest |
31 | 30 | ports: |
32 | | - - 27017:27017 |
| 31 | + - 27017:27017 |
33 | 32 | volumes: |
34 | | - - mongo_data:/data/db |
35 | | - - mongo_config:/data/configdb |
| 33 | + - mongo_data:/data/db |
| 34 | + - mongo_config:/data/configdb |
36 | 35 |
|
37 | 36 | steps: |
38 | | - - name: Checkout |
39 | | - uses: actions/checkout@v6 |
40 | | - with: |
41 | | - fetch-depth: 0 |
42 | | - |
43 | | - - name: Install .NET Core |
44 | | - uses: actions/setup-dotnet@v5 |
45 | | - with: |
46 | | - dotnet-version: | |
47 | | - 6.0.x |
48 | | - 7.0.x |
49 | | - 8.0.x |
50 | | -
|
51 | | - - name: Restore Dependencies |
52 | | - run: dotnet restore |
53 | | - |
54 | | - - name: Build Solution |
55 | | - run: dotnet build --no-restore --configuration Release |
56 | | - |
57 | | - - name: Run Test |
58 | | - run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings |
59 | | - |
60 | | - - name: Report Coverage |
61 | | - if: success() |
62 | | - uses: coverallsapp/github-action@v2 |
63 | | - with: |
64 | | - file: '${{github.workspace}}/test/*/TestResults/*/coverage.info' |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v6 |
| 39 | + with: |
| 40 | + fetch-depth: 0 |
| 41 | + |
| 42 | + - name: Install .NET Core |
| 43 | + uses: actions/setup-dotnet@v5 |
| 44 | + with: |
| 45 | + dotnet-version: 10.x |
| 46 | + |
| 47 | + - name: Restore Dependencies |
| 48 | + run: dotnet restore |
| 49 | + |
| 50 | + - name: Build Solution |
| 51 | + run: dotnet build --no-restore --configuration Release |
| 52 | + |
| 53 | + - name: Run Test |
| 54 | + run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings |
| 55 | + |
| 56 | + - name: Report Coverage |
| 57 | + if: success() |
| 58 | + uses: coverallsapp/github-action@v2 |
| 59 | + with: |
| 60 | + file: "${{github.workspace}}/test/*/TestResults/*/coverage.info" |
65 | 61 | format: lcov |
66 | 62 |
|
67 | | - - name: Create Packages |
68 | | - if: success() && github.event_name != 'pull_request' |
69 | | - run: dotnet pack --configuration Release --no-build --output "${{env.BUILD_PATH}}" |
| 63 | + - name: Create Packages |
| 64 | + if: success() && github.event_name != 'pull_request' |
| 65 | + run: dotnet pack --configuration Release --no-build --output "${{env.BUILD_PATH}}" |
70 | 66 |
|
71 | | - - name: Upload Packages |
72 | | - if: success() && github.event_name != 'pull_request' |
73 | | - uses: actions/upload-artifact@v6 |
74 | | - with: |
75 | | - name: packages |
76 | | - path: '${{env.BUILD_PATH}}' |
| 67 | + - name: Upload Packages |
| 68 | + if: success() && github.event_name != 'pull_request' |
| 69 | + uses: actions/upload-artifact@v6 |
| 70 | + with: |
| 71 | + name: packages |
| 72 | + path: "${{env.BUILD_PATH}}" |
77 | 73 |
|
78 | 74 | deploy: |
79 | 75 | runs-on: ubuntu-latest |
80 | 76 | needs: build |
81 | 77 | if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) |
82 | 78 |
|
83 | 79 | steps: |
84 | | - - name: Download Artifact |
85 | | - uses: actions/download-artifact@v7 |
86 | | - with: |
87 | | - name: packages |
88 | | - |
89 | | - - name: Publish Packages GitHub |
90 | | - run: | |
91 | | - for package in $(find -name "*.nupkg"); do |
92 | | - echo "${0##*/}": Pushing $package... |
93 | | - dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
94 | | - done |
95 | | -
|
96 | | - - name: Publish Packages feedz |
97 | | - run: | |
98 | | - for package in $(find -name "*.nupkg"); do |
99 | | - echo "${0##*/}": Pushing $package... |
100 | | - dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate |
101 | | - done |
102 | | -
|
103 | | - - name: Publish Packages Nuget |
104 | | - if: startsWith(github.ref, 'refs/tags/v') |
105 | | - run: | |
106 | | - for package in $(find -name "*.nupkg"); do |
107 | | - echo "${0##*/}": Pushing $package... |
108 | | - dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate |
109 | | - done |
110 | | -
|
| 80 | + - name: Download Artifact |
| 81 | + uses: actions/download-artifact@v7 |
| 82 | + with: |
| 83 | + name: packages |
| 84 | + |
| 85 | + - name: Publish Packages GitHub |
| 86 | + run: | |
| 87 | + for package in $(find -name "*.nupkg"); do |
| 88 | + echo "${0##*/}": Pushing $package... |
| 89 | + dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
| 90 | + done |
| 91 | +
|
| 92 | + - name: Publish Packages feedz |
| 93 | + run: | |
| 94 | + for package in $(find -name "*.nupkg"); do |
| 95 | + echo "${0##*/}": Pushing $package... |
| 96 | + dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate |
| 97 | + done |
| 98 | +
|
| 99 | + - name: Publish Packages Nuget |
| 100 | + if: startsWith(github.ref, 'refs/tags/v') |
| 101 | + run: | |
| 102 | + for package in $(find -name "*.nupkg"); do |
| 103 | + echo "${0##*/}": Pushing $package... |
| 104 | + dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate |
| 105 | + done |
0 commit comments