@@ -2,46 +2,72 @@ name: publish to NuGet
22
33on :
44 push :
5- branches :
6- - master
5+ tags :
6+ - ' releases/* '
77
88jobs :
99 publish :
10-
11- env :
12- KEY : ' ${{secrets.NUGET_SECRET}}'
13-
1410 runs-on : ubuntu-latest
1511
1612 steps :
17- - uses : actions/checkout@v2
18- - name : Setup .NET Core
19- uses : actions/setup-dotnet@v1
13+ - name : Checkout
14+ uses : actions/checkout@v3
15+ with :
16+ # This is necessary so that we have the tags.
17+ fetch-depth : 0
18+ - name : Set Build Version
19+ run : |
20+ $Version = "$env:GITHUB_REF_NAME"
21+
22+ $File = (
23+ Select-Xml -XPath "/Project/PropertyGroup[@Label='NuGet']/Version" -Path "Directory.Build.targets"
24+ )[0].Node
25+
26+ $File.InnerText = $Version
27+ $File.OwnerDocument.Save((Join-Path $PWD.ProviderPath Directory.Build.targets))
28+ shell : pwsh
2029
21- - name : Pack FSharp.Data.GraphQL.Shared project and push to NuGet
22- if : startsWith(github.ref, 'refs/tags/release')
30+ - name : Install .NET Core
31+ uses : actions/setup-dotnet@v3
32+
33+ - name : Install local tools
34+ run : dotnet tool restore
35+
36+ - name : Run integration tests
37+ run : dotnet fsi build.fsx
38+
39+ - name : Pack FSharp.Data.GraphQL.Shared project
2340 run : |
2441 cd src/FSharp.Data.GraphQL.Shared
25- dotnet pack --nologo --configuration Release /p:IsNuget=true -o ../../nuget
26- dotnet nuget push ../../nuget/*Shared*.nupkg -k $KEY
42+ dotnet pack --no-build --nologo --configuration Release /p:IsNuget=true -o ../../nuget
43+ - name : Publish FSharp.Data.GraphQL.Shared project to NuGet
44+ run : |
45+ cd src/FSharp.Data.GraphQL.Shared
46+ dotnet nuget push ../../nuget/*Shared*.nupkg -k ${{secrets.NUGET_SECRET}}
2747
28- - name : Pack FSharp.Data.GraphQL.Client project and push to NuGet
29- if : startsWith(github.ref, 'refs/tags/release')
48+ - name : Pack FSharp.Data.GraphQL.Client project
3049 run : |
3150 cd src/FSharp.Data.GraphQL.Client
32- dotnet pack --nologo --configuration Release /p:IsNuget=true -o ../../nuget
33- dotnet nuget push ../../nuget/*Client*.nupkg -k $KEY
51+ dotnet pack --no-build --nologo --configuration Release /p:IsNuget=true -o ../../nuget
52+ - name : Publish FSharp.Data.GraphQL.Client project to NuGet
53+ run : |
54+ cd src/FSharp.Data.GraphQL.Client
55+ dotnet nuget push ../../nuget/*Client*.nupkg -k ${{secrets.NUGET_SECRET}}
3456
35- - name : Pack FSharp.Data.GraphQL.Server project and push to NuGet
36- if : startsWith(github.ref, 'refs/tags/release')
57+ - name : Pack FSharp.Data.GraphQL.Server project
3758 run : |
3859 cd src/FSharp.Data.GraphQL.Server
39- dotnet pack --nologo --configuration Release /p:IsNuget=true -o ../../nuget
40- dotnet nuget push ../../nuget/*Server*.nupkg -k $KEY
60+ dotnet pack --no-build --nologo --configuration Release /p:IsNuget=true -o ../../nuget
61+ - name : Publish FSharp.Data.GraphQL.Server project to NuGet
62+ run : |
63+ cd src/FSharp.Data.GraphQL.Server
64+ dotnet nuget push ../../nuget/*Server*.nupkg -k ${{secrets.NUGET_SECRET}}
4165
42- - name : Pack FSharp.Data.GraphQL.Server.Middleware project and push to NuGet
43- if : startsWith(github.ref, 'refs/tags/release')
66+ - name : Pack FSharp.Data.GraphQL.Server.Middleware project
4467 run : |
4568 cd src/FSharp.Data.GraphQL.Server.Middleware
4669 dotnet pack --nologo --configuration Release /p:IsNuget=true -o ../../nuget
47- dotnet nuget push ../../nuget/*Server.Middleware*.nupkg -k $KEY
70+ - name : Publish FSharp.Data.GraphQL.Server.Middleware project to NuGet
71+ run : |
72+ cd src/FSharp.Data.GraphQL.Server.Middleware
73+ dotnet nuget push ../../nuget/*Server.Middleware*.nupkg -k ${{secrets.NUGET_SECRET}}
0 commit comments