32
32
- name : Setup .NET
33
33
uses : actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
34
34
with :
35
- dotnet-version : ' 8.x'
35
+ dotnet-version : |
36
+ 6.0.x
37
+ 8.0.x
36
38
37
39
- name : Build libraries
38
40
run : dotnet build ./libraries/ --configuration Release
61
63
- name : Set up .NET
62
64
uses : actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
63
65
with :
64
- dotnet-version : ' 8.x'
66
+ dotnet-version : |
67
+ 6.0.x
68
+ 8.0.x
65
69
66
70
- name : Download packages
67
71
uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # 4.1.9
73
77
run : |
74
78
dotnet nuget add source ${{ github.workspace }}/packages --name local
75
79
80
+ # Ensure we preserve access to NuGet.org
81
+ - name : Configure NuGet.org source
82
+ run : |
83
+ dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org
84
+
76
85
- name : Update examples to use local packages
77
86
run : |
78
87
find ./examples -name "*.csproj" | while read project; do
@@ -81,17 +90,21 @@ jobs:
81
90
# Extract package name and version
82
91
packageName=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\1/')
83
92
packageVersion=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\2/')
84
-
85
- # Use xmlstarlet to check and update package references
93
+
94
+ # Check if project references this package
86
95
if grep -q "<PackageReference.*Include=\"$packageName\"" "$project"; then
87
96
echo " - Updating $packageName to version $packageVersion"
88
- dotnet add "$project" package "$packageName" --version "$packageVersion" --source ${{ github.workspace }}/packages
97
+ # Use --no-restore to avoid restoring during each add
98
+ dotnet add "$project" package "$packageName" --version "$packageVersion" --source "local" --no-restore
89
99
fi
90
100
done
91
101
done
92
102
103
+ - name : Dotnet restore
104
+ run : dotnet restore ./examples/
105
+
93
106
- name : Test Examples
94
- run : dotnet test ./examples/ --configuration Release --verbosity normal
107
+ run : dotnet test ./examples/ --no-restore -- configuration Release --verbosity normal
95
108
96
109
publish-packages :
97
110
if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
@@ -109,7 +122,9 @@ jobs:
109
122
- name : Setup .NET
110
123
uses : actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0
111
124
with :
112
- dotnet-version : ' 8.x'
125
+ dotnet-version : |
126
+ 6.0.x
127
+ 8.0.x
113
128
114
129
- name : Setup GitHub Packages source
115
130
run : |
0 commit comments