7
7
8
8
env :
9
9
CONFIGURATION : Release
10
+
10
11
jobs :
11
12
build :
12
13
# Sets permissions of the GITHUB_TOKEN to allow release creating
@@ -15,14 +16,39 @@ jobs:
15
16
environment :
16
17
name : nuget
17
18
runs-on : ubuntu-latest
19
+
18
20
steps :
19
21
- uses : actions/checkout@v3
22
+
20
23
- name : Setup necessary dotnet SDKs
21
24
uses : actions/setup-dotnet@v3
22
25
with :
23
26
global-json-file : global.json
24
27
dotnet-version : |
25
28
8.x
29
+
30
+ - name : Add the GitHub source
31
+ run : dotnet nuget add source --name "github.com" "https://nuget.pkg.github.com/fsprojects/index.json"
32
+
33
+ - name : Ensure NuGet package source mapping
34
+ shell : pwsh
35
+ run : |
36
+ $nugetConfigPath = "$HOME/.nuget/NuGet/NuGet.Config"
37
+ [xml]$nugetConfig = Get-Content $nugetConfigPath
38
+ if ($nugetConfig.configuration.packageSourceMapping -ne $null) {
39
+ $nugetConfig.configuration.packageSourceMapping.RemoveAll()
40
+ } else {
41
+ $packageSourceMapping = $nugetConfig.CreateElement("packageSourceMapping")
42
+ $nugetConfig.configuration.AppendChild($packageSourceMapping)
43
+ }
44
+ $nugetSource = $nugetConfig.CreateElement("packageSource")
45
+ $nugetSource.SetAttribute("key", "nuget.org")
46
+ $nugetPattern = $nugetConfig.CreateElement("package")
47
+ $nugetPattern.SetAttribute("pattern", "*")
48
+ $nugetSource.AppendChild($nugetPattern)
49
+ $nugetConfig.configuration.packageSourceMapping.AppendChild($nugetSource)
50
+ $nugetConfig.Save($nugetConfigPath)
51
+
26
52
- name : Publish to GitHub
27
53
env :
28
54
NUGET_TOKEN : ${{ secrets.NUGET_TOKEN }}
0 commit comments