@@ -2,46 +2,72 @@ name: publish to NuGet
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - master
5
+ tags :
6
+ - ' releases/* '
7
7
8
8
jobs :
9
9
publish :
10
-
11
- env :
12
- KEY : ' ${{secrets.NUGET_SECRET}}'
13
-
14
10
runs-on : ubuntu-latest
15
11
16
12
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
20
29
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
23
40
run : |
24
41
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}}
27
47
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
30
49
run : |
31
50
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}}
34
56
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
37
58
run : |
38
59
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}}
41
65
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
44
67
run : |
45
68
cd src/FSharp.Data.GraphQL.Server.Middleware
46
69
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