23
23
name : ${{ matrix.os }}
24
24
runs-on : ${{ matrix.os }}
25
25
26
+ outputs :
27
+ dotnet-sdk-version : ${{ steps.setup-dotnet.outputs.dotnet-version }}
28
+
26
29
strategy :
27
30
fail-fast : false
28
31
matrix :
@@ -37,10 +40,14 @@ jobs:
37
40
38
41
steps :
39
42
- name : Checkout code
40
- uses : actions/checkout@v3
43
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
44
+
45
+ - name : Setup .NET SDK
46
+ uses : actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
47
+ id : setup-dotnet
41
48
42
49
- name : Setup NuGet
43
- uses : nuget/setup-nuget@v1
50
+ uses : nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0
44
51
with :
45
52
nuget-version : ' 5.11.0'
46
53
@@ -71,20 +78,20 @@ jobs:
71
78
run : ./eng/common/cibuild.sh -configuration Release -prepareMachine
72
79
73
80
- name : Publish logs
74
- uses : actions/upload-artifact@v3
81
+ uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
75
82
if : ${{ always() }}
76
83
with :
77
84
name : logs-${{ matrix.os_name }}
78
85
path : ./artifacts/log/Release
79
86
80
87
- name : Publish NuGet packages
81
- uses : actions/upload-artifact@v3
88
+ uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
82
89
with :
83
90
name : packages-${{ matrix.os_name }}
84
91
path : ./artifacts/packages/Release/Shipping
85
92
86
93
- name : Publish test results
87
- uses : actions/upload-artifact@v3
94
+ uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
88
95
if : ${{ always() }}
89
96
with :
90
97
name : testresults-${{ matrix.os_name }}
@@ -96,12 +103,14 @@ jobs:
96
103
steps :
97
104
98
105
- name : Download packages
99
- uses : actions/download-artifact@v3
106
+ uses : actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
100
107
with :
101
108
name : packages-windows
102
109
103
110
- name : Setup .NET SDK
104
- uses : actions/setup-dotnet@v3
111
+ uses : actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
112
+ with :
113
+ dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
105
114
106
115
- name : Validate NuGet packages
107
116
shell : pwsh
@@ -120,7 +129,7 @@ jobs:
120
129
}
121
130
122
131
publish-myget :
123
- needs : validate-packages
132
+ needs : [ build, validate-packages ]
124
133
runs-on : ubuntu-latest
125
134
if : |
126
135
github.event.repository.fork == false &&
@@ -131,31 +140,39 @@ jobs:
131
140
steps :
132
141
133
142
- name : Download packages
134
- uses : actions/download-artifact@v3
143
+ uses : actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
135
144
with :
136
145
name : packages-windows
137
146
138
147
- name : Setup .NET SDK
139
- uses : actions/setup-dotnet@v3
148
+ uses : actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
149
+ with :
150
+ dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
140
151
141
152
- name : Push NuGet packages to aspnet-contrib MyGet
142
- run : nuget push "*.nupkg" -ApiKey ${{ secrets.MYGET_API_KEY }} -SkipDuplicate -Source https://www.myget.org/F/aspnet-contrib/api/v3/index.json
153
+ env :
154
+ MYGET_API_KEY : ${{ secrets.MYGET_API_KEY }}
155
+ run : nuget push "*.nupkg" -ApiKey "${MYGET_API_KEY}" -SkipDuplicate -Source https://www.myget.org/F/aspnet-contrib/api/v3/index.json
143
156
144
157
publish-nuget :
145
- needs : validate-packages
158
+ needs : [ build, validate-packages ]
146
159
runs-on : ubuntu-latest
147
160
if : |
148
161
github.event.repository.fork == false &&
149
162
startsWith(github.ref, 'refs/tags/')
150
163
steps :
151
164
152
165
- name : Download packages
153
- uses : actions/download-artifact@v3
166
+ uses : actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3
154
167
with :
155
168
name : packages-windows
156
169
157
170
- name : Setup .NET SDK
158
- uses : actions/setup-dotnet@v3
171
+ uses : actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
172
+ with :
173
+ dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
159
174
160
175
- name : Push NuGet packages to NuGet.org
161
- run : nuget push "*.nupkg" -ApiKey ${{ secrets.NUGET_API_KEY }} -SkipDuplicate -Source https://api.nuget.org/v3/index.json
176
+ env :
177
+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
178
+ run : nuget push "*.nupkg" -ApiKey "${NUGET_API_KEY}" -SkipDuplicate -Source https://api.nuget.org/v3/index.json
0 commit comments