Skip to content

Commit 4f4e14e

Browse files
authored
Merge pull request #421 from MicrosoftLearning/update-all-dependencies-and-actions
Update all dependencies and GitHub Actions
2 parents 0b256ad + 589d040 commit 4f4e14e

File tree

5 files changed

+111
-115
lines changed

5 files changed

+111
-115
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ name: eShopOnWeb Build and Test
55

66
jobs:
77
build:
8-
98
runs-on: ubuntu-latest
109

1110
steps:
12-
- uses: actions/checkout@v4
13-
- name: Setup .NET
14-
uses: actions/setup-dotnet@v4
15-
with:
16-
dotnet-version: '8.0.x'
17-
dotnet-quality: 'preview'
11+
- uses: actions/checkout@v5
12+
- name: Setup .NET
13+
uses: actions/setup-dotnet@v5
14+
with:
15+
dotnet-version: "8.0.x"
16+
dotnet-quality: "preview"
17+
18+
- name: Build with dotnet
19+
run: dotnet build ./eShopOnWeb.sln --configuration Release
1820

19-
- name: Build with dotnet
20-
run: dotnet build ./eShopOnWeb.sln --configuration Release
21-
22-
- name: Test with dotnet
23-
run: dotnet test ./eShopOnWeb.sln --configuration Release
21+
- name: Test with dotnet
22+
run: dotnet test ./eShopOnWeb.sln --configuration Release

.github/workflows/eshoponweb-cicd.yml

Lines changed: 79 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -11,95 +11,93 @@ env:
1111
SUBSCRIPTION-ID: YOUR-SUBS-ID
1212
WEBAPP-NAME: eshoponweb-webapp-NAME
1313

14-
1514
jobs:
1615
#Build, test and publish .net web project in repository
1716
buildandtest:
1817
runs-on: ubuntu-latest
1918
steps:
20-
#checkout the repository
21-
- uses: actions/checkout@v4
22-
#prepare runner for desired .net version SDK
23-
- name: Setup .NET
24-
uses: actions/setup-dotnet@v4
25-
with:
26-
dotnet-version: '8.0.x'
27-
dotnet-quality: 'preview'
28-
#Build/Test/Publish the .net project
29-
- name: Build with dotnet
30-
run: dotnet build ./eShopOnWeb.sln --configuration Release
31-
- name: Test with dotnet
32-
run: dotnet test ./eShopOnWeb.sln --configuration Release
33-
- name: dotnet publish
34-
run: |
35-
dotnet publish ./src/Web/Web.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
36-
cd ${{env.DOTNET_ROOT}}/myapp
37-
zip -r ../app.zip .
38-
# upload the published website code artifacts
39-
- name: Upload artifact for deployment job
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: .net-app
43-
path: ${{env.DOTNET_ROOT}}/app.zip
44-
45-
# upload the bicep template as artifacts for next job
46-
- name: Upload artifact for deployment job
47-
uses: actions/upload-artifact@v4
48-
with:
49-
name: bicep-template
50-
path: ${{ env.TEMPLATE-FILE }}
51-
52-
# Use Bicep to deploy infrastructure + Publish webapp
19+
#checkout the repository
20+
- uses: actions/checkout@v5
21+
#prepare runner for desired .net version SDK
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v5
24+
with:
25+
dotnet-version: "8.0.x"
26+
dotnet-quality: "preview"
27+
#Build/Test/Publish the .net project
28+
- name: Build with dotnet
29+
run: dotnet build ./eShopOnWeb.sln --configuration Release
30+
- name: Test with dotnet
31+
run: dotnet test ./eShopOnWeb.sln --configuration Release
32+
- name: dotnet publish
33+
run: |
34+
dotnet publish ./src/Web/Web.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
35+
cd ${{env.DOTNET_ROOT}}/myapp
36+
zip -r ../app.zip .
37+
# upload the published website code artifacts
38+
- name: Upload artifact for deployment job
39+
uses: actions/upload-artifact@v5
40+
with:
41+
name: .net-app
42+
path: ${{env.DOTNET_ROOT}}/app.zip
43+
44+
# upload the bicep template as artifacts for next job
45+
- name: Upload artifact for deployment job
46+
uses: actions/upload-artifact@v5
47+
with:
48+
name: bicep-template
49+
path: ${{ env.TEMPLATE-FILE }}
50+
51+
# Use Bicep to deploy infrastructure + Publish webapp
5352
deploy:
5453
runs-on: ubuntu-latest
5554
needs: buildandtest
5655
environment:
57-
name: 'Development'
56+
name: "Development"
5857
steps:
59-
60-
#Download the publish files created in previous job
61-
- name: Download artifact from build job
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: .net-app
65-
path: .net-app
66-
67-
#Download the bicep templates from previous job
68-
- name: Download artifact from build job
69-
uses: actions/download-artifact@v4
70-
with:
71-
name: bicep-template
72-
path: bicep-template
73-
74-
#Login in your azure subscription using a service principal (credentials stored as GitHub Secret in repo)
75-
- name: Azure Login
76-
uses: azure/login@v2
77-
with:
78-
creds: ${{ secrets.AZURE_CREDENTIALS }}
79-
80-
# Deploy Azure WebApp using Bicep file
81-
- name: deploy
82-
uses: azure/arm-deploy@v2
83-
with:
84-
subscriptionId: ${{ env.SUBSCRIPTION-ID }}
85-
resourceGroupName: ${{ env.RESOURCE-GROUP }}
86-
template: bicep-template/webapp.bicep
87-
parameters: 'webAppName=${{ env.WEBAPP-NAME }} location=${{ env.LOCATION }}'
88-
failOnStdErr: false
89-
90-
# Publish website to Azure App Service (WebApp)
91-
# Step disabled due to issue where the site sometimes can't be found: https://github.com/microsoft/pipelines-appservice-lib/issues/56. Instead deploy using CLI
92-
- name: Publish Website to WebApp
93-
if: false #Disable step due to comment above
94-
uses: Azure/webapps-deploy@v3
95-
with:
96-
type: ZIP
97-
app-name: ${{ env.WEBAPP-NAME }}
98-
package: .net-app/app.zip
58+
#Download the publish files created in previous job
59+
- name: Download artifact from build job
60+
uses: actions/download-artifact@v6
61+
with:
62+
name: .net-app
63+
path: .net-app
64+
65+
#Download the bicep templates from previous job
66+
- name: Download artifact from build job
67+
uses: actions/download-artifact@v6
68+
with:
69+
name: bicep-template
70+
path: bicep-template
71+
72+
#Login in your azure subscription using a service principal (credentials stored as GitHub Secret in repo)
73+
- name: Azure Login
74+
uses: azure/login@v2
75+
with:
76+
creds: ${{ secrets.AZURE_CREDENTIALS }}
77+
78+
# Deploy Azure WebApp using Bicep file
79+
- name: deploy
80+
uses: azure/arm-deploy@v2
81+
with:
82+
subscriptionId: ${{ env.SUBSCRIPTION-ID }}
83+
resourceGroupName: ${{ env.RESOURCE-GROUP }}
84+
template: bicep-template/webapp.bicep
85+
parameters: "webAppName=${{ env.WEBAPP-NAME }} location=${{ env.LOCATION }}"
86+
failOnStdErr: false
87+
88+
# Publish website to Azure App Service (WebApp)
89+
# Step disabled due to issue where the site sometimes can't be found: https://github.com/microsoft/pipelines-appservice-lib/issues/56. Instead deploy using CLI
90+
- name: Publish Website to WebApp
91+
if: false #Disable step due to comment above
92+
uses: Azure/webapps-deploy@v3
93+
with:
94+
type: ZIP
95+
app-name: ${{ env.WEBAPP-NAME }}
96+
package: .net-app/app.zip
9997

100-
# Publish website to Azure App Service using CLI (WebApp)
101-
- name: Publish Website to WebApp
102-
uses: Azure/cli@v2
103-
with:
104-
inlineScript: |
105-
az webapp deploy --name ${{ env.WEBAPP-NAME }} --resource-group ${{ env.RESOURCE-GROUP }} --src-path .net-app/app.zip --type zip
98+
# Publish website to Azure App Service using CLI (WebApp)
99+
- name: Publish Website to WebApp
100+
uses: Azure/cli@v2
101+
with:
102+
inlineScript: |
103+
az webapp deploy --name ${{ env.WEBAPP-NAME }} --resource-group ${{ env.RESOURCE-GROUP }} --src-path .net-app/app.zip --type zip

.github/workflows/richnav.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ on: workflow_dispatch
44

55
jobs:
66
build:
7-
87
runs-on: windows-latest
98

109
steps:
11-
- uses: actions/checkout@v4
12-
- name: Setup .NET Core
13-
uses: actions/setup-dotnet@v4
14-
with:
15-
dotnet-version: 8.0.x
10+
- uses: actions/checkout@v5
11+
- name: Setup .NET Core
12+
uses: actions/setup-dotnet@v5
13+
with:
14+
dotnet-version: 8.0.x
1615

17-
- name: Build with dotnet
18-
run: dotnet build ./Everything.sln --configuration Release /bl
16+
- name: Build with dotnet
17+
run: dotnet build ./Everything.sln --configuration Release /bl
1918

20-
- uses: microsoft/[email protected]
21-
with:
22-
repo-token: ${{ github.token }}
23-
languages: 'csharp'
24-
environment: 'internal'
19+
- uses: microsoft/[email protected]
20+
with:
21+
repo-token: ${{ github.token }}
22+
languages: "csharp"
23+
environment: "internal"

Directory.Packages.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</PropertyGroup>
1010
<ItemGroup>
1111
<PackageVersion Include="Ardalis.ApiEndpoints" Version="4.1.0" />
12-
<PackageVersion Include="Ardalis.GuardClauses" Version="4.5.0" />
13-
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="8.0.0" />
12+
<PackageVersion Include="Ardalis.GuardClauses" Version="5.0.0" />
13+
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="9.3.1" />
1414
<PackageVersion Include="Ardalis.Result" Version="10.1.0" />
15-
<PackageVersion Include="Ardalis.Specification" Version="8.0.0" />
15+
<PackageVersion Include="Ardalis.Specification" Version="9.3.1" />
1616
<PackageVersion Include="Ardalis.ListStartupServices" Version="1.1.4" />
17-
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
18-
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
17+
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.4.0" />
18+
<PackageVersion Include="Azure.Identity" Version="1.16.0" />
1919
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
2020
<PackageVersion Include="BlazorInputFile" Version="0.2.0" />
2121
<PackageVersion Include="Blazored.LocalStorage" Version="4.5.0" />
@@ -41,7 +41,7 @@
4141
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.8" />
4242
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.0.0" />
4343
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0" />
44-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
44+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.8">
4545
<PrivateAssets>all</PrivateAssets>
4646
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4747
</PackageVersion>
@@ -52,7 +52,7 @@
5252
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
5353
<PackageVersion Include="System.Net.Http.Json" Version="$(SystemExtensionVersion)" />
5454
<PackageVersion Include="System.Security.Claims" Version="4.3.0" />
55-
<PackageVersion Include="System.Text.Json" Version="9.0.4" />
55+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
5656
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.8.1" />
5757
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.1.1" />
5858
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.3.1" />

src/Web/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@
123123
.ConfigureRefresh(refresh =>
124124
{
125125
// Default cache expiration is 30 seconds
126-
refresh.Register("eShopWeb:Settings:NoResultsMessage").SetCacheExpiration(TimeSpan.FromSeconds(10));
126+
refresh.Register("eShopWeb:Settings:NoResultsMessage").SetRefreshInterval(TimeSpan.FromSeconds(10));
127127
})
128128
.UseFeatureFlags(featureFlagOptions =>
129129
{
130130
// Default cache expiration is 30 seconds
131-
featureFlagOptions.CacheExpirationInterval = TimeSpan.FromSeconds(10);
131+
featureFlagOptions.SetRefreshInterval(TimeSpan.FromSeconds(10));
132132
});
133133
});
134134
}

0 commit comments

Comments
 (0)