-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (39 loc) · 1.8 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: nuget/setup-nuget@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
- name: Update version
run: |
(Get-Content -Path src\CronExpressionsVsix\source.extension.vsixmanifest) |
ForEach-Object {$_ -Replace '1.0.0', '1.0.${{ github.run_number }}'} |
Set-Content -Path src\CronExpressionsVsix\source.extension.vsixmanifest
(Get-Content -Path src\CronExpressions.Analyzers\CronExpressions.Analyers.csproj) |
ForEach-Object {$_ -Replace '1.0.0.0', '1.0.${{ github.run_number }}.0'} |
Set-Content -Path src\CronExpressions.Analyzers\CronExpressions.Analyers.csproj
- name: Restore
run: nuget restore
- name: Build
run: msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
- name: Test
run: dotnet vstest test\CronExpressions.Test\bin\Release\net472\CronExpressions.Test.dll
- uses: actions/upload-artifact@v3
with:
name: CronExpressions.vsix
path: src\CronExpressionsVsix\bin\Release\CronExpressionsVsix.vsix
- uses: actions/upload-artifact@v3
with:
name: CronExpressions.Analyzers.1.0.${{ github.run_number }}.nupkg
path: src\CronExpressions.Analyzers\bin\Release\CronExpressions.Analyzers.1.0.${{ github.run_number }}.nupkg
- name: Push CronExpressions.Analyers to nuget.org
run: dotnet nuget push src\CronExpressions.Analyzers\bin\Release\CronExpressions.Analyzers.1.0.${{ github.run_number }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
if: ${{ github.event_name == 'push' }}