Skip to content

Commit

Permalink
Merge pull request #164 from Aguafrommars/fix/dependencies
Browse files Browse the repository at this point in the history
ci: bump dotnet
  • Loading branch information
aguacongas authored Nov 18, 2023
2 parents 57ea4f0 + 3b97968 commit a2571a7
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
# Run update depencies script
- name: Update dependencies
run: ./update-dependencies.ps1
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ branches:
- /release\/*/
image:
- Ubuntu2004
- Visual Studio 2019
- Visual Studio 2022
environment:
GH_TOKEN:
secure: /o9VAhx5ewGmdLR9qcgFJMzBaCuzOmGlsXAHu7khUJLdQzsv4gJzLUfYDghcRPHd
Expand All @@ -24,7 +24,7 @@ environment:
secure: h7zhWIG5sQBVM6loU77ClQ==
decrypt_secret:
secure: BDKOW5teXcJUwLqekbf6VQ==
donetsdk: 7.0.403
donetsdk: 8.0.100
init:
- cmd: git config --global core.autocrlf true
install:
Expand All @@ -49,7 +49,7 @@ install:
- sh: mono secure-file/tools/secure-file.exe -decrypt test/testsettings.json.enc -secret $decrypt_secret
- sh: mono secure-file/tools/secure-file.exe -decrypt test/identityfirestore.json.enc -secret $decrypt_secret
- ps: ./appveyorinit.ps1
- cmd: set JAVA_HOME=C:\Program Files\Java\jdk14
- cmd: set JAVA_HOME=C:\Program Files\Java\jdk19
- cmd: set PATH=%JAVA_HOME%\bin;%PATH%
build_script:
- ps: ./build.ps1
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if ($isLinux) {
$merge = "$merge;$path"
}
Write-Host $merge
ReportGenerator\tools\net7.0\ReportGenerator.exe "-reports:$merge" "-targetdir:coverage" "-reporttypes:SonarQube"
ReportGenerator\tools\net8.0\ReportGenerator.exe "-reports:$merge" "-targetdir:coverage" "-reporttypes:SonarQube"

dotnet sonarscanner end -d:sonar.login=$env:sonarqube
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Identity sample MVC application on ASP.NET Core</Description>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Firestore.IdentitySample.Mvc</UserSecretsId>
<SonarQubeExclude>true</SonarQubeExclude>
</PropertyGroup>
Expand All @@ -17,15 +17,15 @@

<ItemGroup>
<PackageReference Include="Aguacongas.Identity.Firestore" Version="3.3.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Identity sample MVC application on ASP.NET Core</Description>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firebase.IntegrationTest</UserSecretsId>
<SonarQubeExclude>true</SonarQubeExclude>
</PropertyGroup>
Expand All @@ -17,15 +17,15 @@

<ItemGroup>
<PackageReference Include="Aguacongas.Identity.Firebase" Version="3.3.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Apis.Auth" Version="1.63.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.64.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.0" />
<PackageReference Include="Google.Cloud.Firestore" Version="3.4.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions test/Aguacongas.Firebase.Test/Aguacongas.Firebase.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firebase.IntegrationTest</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -11,8 +11,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firebase.IntegrationTest</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -12,8 +12,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Identity.Specification.Tests" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firebase.IntegrationTest</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -12,8 +12,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Identity.Specification.Tests" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firestore.IntegrationTest</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -16,8 +16,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Identity.Specification.Tests" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>Aguacongas.Identity.Firestore.IntegrationTest</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -12,8 +12,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Identity.Specification.Tests" Version="5.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand Down
105 changes: 80 additions & 25 deletions update-dependencies.ps1
Original file line number Diff line number Diff line change
@@ -1,47 +1,101 @@
# Update one project packages
function UpdatePackages {
param (
$project
$project
)

$currentDirectoy = Get-Location

$return = $false

$dir = Split-Path $project
Write-Host 'Set-Location' $dir

Set-Location $dir

# Get outdated packages
$packageLineList = dotnet list $project package --outdated
$packageLineList = dotnet list package --outdated

foreach($line in $packageLineList) {
Write-Host $line
foreach ($line in $packageLineList) {
Write-Host $line

$match = $line -match '>\s(\S*)\s*\S*\s*\S*\s*(\S*)'
if (!$match) {
# the line doesn't contain a package information, continue
continue
}

$match = $line -match '>\s(\S*)\s*\S*\s*\S*\s*(\S*)'
if (!$match) {
# the line doesn't contain a package information, continue
continue
}
Write-Host $match

# update an outdated package
$added = dotnet add $project package $Matches.1 --version $Matches.2
$packageName = $Matches.1
$version = $Matches.2
if ($version -eq "Not") {
# latest version not found
$preReleasePackageLineList = dotnet list package --outdated --include-prerelease

if ($LASTEXITCODE -ne 0) {
# error while updating the package
Write-Error "dotnet add $project package $Matches.1 --version $Matches.2 exit with code $LASTEXITCODE"
Write-Host $added
break
}
foreach ($preReleaseLine in $preReleasePackageLineList) {
Write-Host $preReleaseLine
$preReleaseMatch = $preReleaseLine -match '>\s(\S*)\s*\S*\s*\S*\s*(\S*)'
if (!$preReleaseMatch) {
# the line doesn't contain a package information, continue
continue
}

$return = $true
}
if ($packageName -ne $Matches.1) {
continue
}

$latestVersion = $Matches.2
if ($latestVersion -match '-rc') {
$version = $latestVersion
Write-Host "Release candidate version found for $packageName : $version"
}
break
}
}

if ($version -eq "Not") {
continue
}

# update an outdated package
$added = dotnet add package $packageName --version $version
if ($LASTEXITCODE -ne 0) {
# error while updating the package

Write-Error "dotnet add package $packageName --version $version exit with code $LASTEXITCODE"
Write-Host $added
break
}

Write-Host 'package' $Matches.1 'version' $Matches.2 'updated'
$return = $true
}

Set-Location $currentDirectoy
return $return
}

# get branches names
$dest = "master"
if (Test-Path env:DEST_BRANCH) {
$dest = $env:DEST_BRANCH
}
$src = "fix/dependencies"
if (Test-Path env:SRC_BRANCH) {
$src = $env:SRC_BRANCH
}

Write-Host "src:$src dest: $dest"

# Restore dependencies
dotnet restore

# Get all project list in the solution
$projectList = dotnet sln list
$updated = $false

foreach($path in $projectList) {
foreach ($path in $projectList) {
if ($path -eq "Project(s)" -or $path -eq "----------") {
# The line doesn't contain a path, continue
continue
Expand Down Expand Up @@ -80,8 +134,9 @@ git commit -m "fix: update packages"
Write-Host "git push"

try {
git push
} catch {
git push
}
catch {

}

Expand All @@ -90,8 +145,8 @@ $authorization = "Bearer $env:GITHUB_TOKEN"
$createPrUrl = "https://api.github.com/repos/$env:GITHUB_REPOSITORY/pulls"
$headers = @{
Authorization = $authorization
Accept = "application/vnd.github.v3+json"
Accept = "application/vnd.github.v3+json"
}
$payload = "{ ""title"": ""update packages"", ""head"": ""fix/dependencies"", ""base"": ""master"" }"
$payload = "{ ""title"": ""update packages"", ""head"": ""$src"", ""base"": ""$dest"" }"
Write-Host "Invoke-WebRequest -Uri $createPrUrl -Body $payload"
Invoke-WebRequest -Uri $createPrUrl -Headers $headers -Method "POST" -Body $payload
Invoke-WebRequest -Uri $createPrUrl -Headers $headers -Method "POST" -Body $payload

0 comments on commit a2571a7

Please sign in to comment.