@@ -2,31 +2,39 @@ 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
10
11
11
runs-on : ubuntu-latest
12
12
13
13
steps :
14
- - uses : actions/checkout@v2
15
-
16
- # Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest
17
- # Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest
18
- # - name: Setup dotnet
19
- # uses: actions/setup-dotnet@v1
20
- # with:
21
- # dotnet-version: 3.1.100
22
-
23
- # Publish
24
- - name : publish on version change
25
- uses : rohith/publish-nuget@v2
26
- with :
27
- PROJECT_FILE_PATH : src/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj # Relative to repository root
28
- # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
29
- # VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
30
- # TAG_COMMIT: true # Flag to enable / disalge git tagging
31
- # TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
32
- NUGET_KEY : ${{secrets.NuGet_Key}}
14
+ - name : Checkout
15
+ uses : actions/checkout@v3
16
+ with :
17
+ # This is necessary so that we have the tags.
18
+ fetch-depth : 0
19
+
20
+ - name : Set Build Version
21
+ run : |
22
+ $version = "$env:GITHUB_REF_NAME"
23
+ $File = (
24
+ Select-Xml -XPath "/Project/PropertyGroup/Version" -Path "src/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj"
25
+ )[0].Node
26
+ $File.InnerText = $version
27
+ $File.OwnerDocument.Save((Join-Path $PWD.ProviderPath src/FSharp.Collections.Immutable/FSharp.Collections.Immutable.fsproj))
28
+ echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
29
+ shell : pwsh
30
+
31
+ - name : Install .NET Core
32
+ uses : actions/setup-dotnet@v3
33
+
34
+ - name : Pack FSharp.Collections.Immutable project
35
+ run : |
36
+ dotnet pack --nologo --configuration Release -o nuget
37
+
38
+ - name : Publish FSharp.Collections.Immutable project to GitHub
39
+ run : |
40
+ dotnet nuget push nuget/FSharp.Collections.Immutable*.nupkg -k ${{secrets.NUGET_SECRET}}
0 commit comments