Skip to content

Commit a2b8fad

Browse files
authored
Merge pull request #3 from DbUp/release/6.0.0
Release 6.0
2 parents ff15148 + c77ddde commit a2b8fad

18 files changed

+74
-169
lines changed

.github/workflows/main.yml

+4-69
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,12 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- '**' # Ignores pushes of tags
57
pull_request:
68
workflow_dispatch:
79

810
jobs:
911
build:
10-
runs-on: windows-latest # Use Ubuntu in v5.0
11-
12-
env:
13-
DOTNET_NOLOGO: true
14-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache
15-
16-
steps:
17-
- uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0 # all
20-
21-
- name: Setup .NET 2.0 # Remove in v5.0
22-
uses: actions/setup-dotnet@v1
23-
with:
24-
dotnet-version: 2.0.x
25-
26-
- name: Setup .NET 8.0
27-
uses: actions/setup-dotnet@v1
28-
with:
29-
dotnet-version: 8.0.x
30-
31-
- name: Install GitVersion
32-
uses: gittools/actions/gitversion/setup@v0
33-
with:
34-
versionSpec: '5.x'
35-
36-
- name: Run GitVersion
37-
id: gitversion
38-
uses: gittools/actions/gitversion/execute@v0
39-
40-
- name: Display SemVer
41-
run: |
42-
echo "SemVer: $env:GitVersion_SemVer"
43-
44-
- name: Add DbUp NuGet Source
45-
run: dotnet nuget add source --name DbUp --username DbUp --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/DbUp/index.json
46-
47-
- name: Restore
48-
run: dotnet restore
49-
working-directory: src
50-
51-
- name: Build
52-
run: dotnet build -c Release --no-restore /p:Version=$env:GitVersion_SemVer
53-
working-directory: src
54-
55-
- name: Test
56-
run: dotnet test --no-build -c Release --logger trx --logger "console;verbosity=detailed" --results-directory ../artifacts
57-
working-directory: src
58-
59-
- name: Pack
60-
run: dotnet pack --no-build -c Release -o ../artifacts /p:Version=$env:GitVersion_SemVer
61-
working-directory: src
62-
63-
- name: Push NuGet packages to GitHub Packages ⬆️
64-
working-directory: artifacts
65-
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json"
66-
67-
- name: Push NuGet packages to NuGet ⬆️
68-
if: ${{ steps.gitversion.outputs.preReleaseLabel == '' }}
69-
working-directory: artifacts
70-
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
71-
72-
- name: Test Report 🧪
73-
uses: dorny/test-reporter@v1
74-
if: ${{ always() }}
75-
with:
76-
name: Tests
77-
path: artifacts/*.trx
78-
reporter: dotnet-trx
12+
name: Build
13+
uses: DbUp/Universe/.github/workflows/build.yml@main

.github/workflows/publish-release.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Publish DbUp Packages to NuGet
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
name: Publish Package
11+
uses: DbUp/Universe/.github/workflows/publish-release.yml@main
12+
secrets: inherit

.github/workflows/test-report.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Test Report
2+
run-name: Generate Test Report for run `${{ github.event.workflow_run.run_number }}` branch `${{ github.event.workflow_run.head_branch }}`
3+
4+
on:
5+
workflow_run:
6+
workflows: ["CI", "build"]
7+
types: [completed]
8+
9+
jobs:
10+
report:
11+
name: Test Report 🧪
12+
uses: DbUp/Universe/.github/workflows/test-report.yml@main

src/Directory.Build.props

-14
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,4 @@
1010
<LangVersion>latest</LangVersion>
1111
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1212
</PropertyGroup>
13-
14-
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' Or '$(CI)' == 'true'">
15-
16-
<!-- Perform a deterministic build, so our binaries aren't impacted by build server environmental factors (e.g. file paths). -->
17-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
18-
19-
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
20-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21-
22-
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
23-
<DebugType>embedded</DebugType>
24-
25-
</PropertyGroup>
26-
2713
</Project>

src/Sample/Sample.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<ProjectReference Include="..\dbup-firebird\dbup-firebird.csproj"/>
10-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0"/>
10+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.verified.txt src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'schemaversions'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'schemaversions'
1010
DB Operation: Dispose command
1111
Info: Creating the "schemaversions" table

src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyJournalCreationIfNameChanged.verified.txt src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyJournalCreationIfNameChanged.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'TestSchemaVersions'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'TestSchemaVersions'
1010
DB Operation: Dispose command
1111
Info: Creating the "TestSchemaVersions" table

src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.verified.txt src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'schemaversions'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from RDB$RELATIONS where RDB$SYSTEM_FLAG = 0 and RDB$RELATION_NAME = 'schemaversions'
1010
DB Operation: Dispose command
1111
Info: Creating the "schemaversions" table

src/Tests/ApprovalFiles/NoPublicApiChanges.Run.Net.verified.cs

-45
This file was deleted.

src/Tests/DatabaseSupportTests.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !NETCORE
2-
using DbUp.Builder;
1+
using DbUp.Builder;
32
using DbUp.Firebird;
43
using DbUp.Tests.Common;
54

@@ -20,4 +19,3 @@ protected override UpgradeEngineBuilder AddCustomNamedJournalToBuilder(UpgradeEn
2019
=> new FirebirdTableJournal(connectionManagerFactory, logFactory, tableName)
2120
);
2221
}
23-
#endif

src/Tests/NoPublicApiChanges.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !NETCORE
2-
using DbUp.Tests.Common;
1+
using DbUp.Tests.Common;
32

43
namespace DbUp.Tests.Providers.Firebird;
54

@@ -10,4 +9,3 @@ public NoPublicApiChanges()
109
{
1110
}
1211
}
13-
#endif

src/Tests/Tests.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;net8</TargetFrameworks>
4+
<TargetFramework>net8</TargetFramework>
55
<AssemblyName>Tests</AssemblyName>
66
<RootNamespace>DbUp.Firebird.Tests</RootNamespace>
7-
<!-- <ImplicitUsings>enable</ImplicitUsings> Can't use implict usings with net46 -->
7+
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\dbup-firebird\dbup-firebird.csproj"/>
13-
<PackageReference Include="DbUp.Tests.Common" Version="5.0.37"/>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
15-
<PackageReference Include="xunit" Version="2.6.6"/>
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
13+
<PackageReference Include="DbUp.Tests.Common" Version="6.0.4" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
15+
<PackageReference Include="xunit" Version="2.9.2" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>

src/dbup-firebird.sln.DotSettings

+3
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String>
66
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
77
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
8+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
9+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
10+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
811
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>
912
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data /&gt;</s:String></wpf:ResourceDictionary>

src/dbup-firebird/FirebirdExtensions.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ public static void FirebirdDatabase(this SupportedDatabasesForEnsureDatabase sup
8282
if (!File.Exists(builder.Database))
8383
{
8484
FbConnection.CreateDatabase(builder.ToString());
85-
logger.WriteInformation("Created database {0}", builder.Database);
85+
logger.LogInformation("Created database {0}", builder.Database);
8686
}
8787
else
8888
{
89-
logger.WriteInformation("Database {0} already exists", builder.Database);
89+
logger.LogInformation("Database {0} already exists", builder.Database);
9090
}
9191
}
9292
else
@@ -96,26 +96,26 @@ public static void FirebirdDatabase(this SupportedDatabasesForEnsureDatabase sup
9696
{
9797
conn.Open();
9898
conn.Close();
99-
logger.WriteInformation("Database {0} already exists", builder.Database);
99+
logger.LogInformation("Database {0} already exists", builder.Database);
100100
}
101101
catch (FbException ex) when (ex.ErrorCode == FbIoError)
102102
{
103103
FbConnection.CreateDatabase(builder.ToString());
104-
logger.WriteInformation("Created database {0}", builder.Database);
104+
logger.LogInformation("Created database {0}", builder.Database);
105105
}
106106
catch (FbException ex) when (ex.ErrorCode == FbNetworkError)
107107
{
108-
logger.WriteError("Could not access server. The server: {0} is probably not started.", builder.DataSource);
108+
logger.LogError("Could not access server. The server: {0} is probably not started.", builder.DataSource);
109109
throw;
110110
}
111111
catch (FbException)
112112
{
113-
logger.WriteError("Ensure Database: Unknown firebird error when trying to access the server: {0}.", builder.DataSource);
113+
logger.LogError("Ensure Database: Unknown firebird error when trying to access the server: {0}.", builder.DataSource);
114114
throw;
115115
}
116116
catch (Exception)
117117
{
118-
logger.WriteError("Ensure Database: Unknown error when trying to access the server: {0}.", builder.DataSource);
118+
logger.LogError("Ensure Database: Unknown error when trying to access the server: {0}.", builder.DataSource);
119119
throw;
120120
}
121121
}
@@ -140,7 +140,7 @@ public static void FirebirdDatabase(this SupportedDatabasesForDropDatabase suppo
140140
if (File.Exists(builder.Database))
141141
{
142142
FbConnection.DropDatabase(builder.ToString());
143-
logger.WriteInformation("Dropped database {0}", builder.Database);
143+
logger.LogInformation("Dropped database {0}", builder.Database);
144144
}
145145
}
146146
else
@@ -150,25 +150,25 @@ public static void FirebirdDatabase(this SupportedDatabasesForDropDatabase suppo
150150
//There seems to be an error in the FirebirdClient when trying to drop a database that does not exist.
151151
//It gives a NullRefException instead of the expected FbException.
152152
FbConnection.DropDatabase(builder.ToString());
153-
logger.WriteInformation("Dropped database {0}", builder.Database);
153+
logger.LogInformation("Dropped database {0}", builder.Database);
154154
}
155155
catch (FbException ex) when (ex.ErrorCode == FbIoError)
156156
{
157-
logger.WriteWarning("Nothing to Drop. No database found.");
157+
logger.LogWarning("Nothing to Drop. No database found.");
158158
}
159159
catch (FbException ex) when (ex.ErrorCode == FbLockTimeout)
160160
{
161-
logger.WriteError("Can't drop database. Are there still an active connection?");
161+
logger.LogError("Can't drop database. Are there still an active connection?");
162162
throw;
163163
}
164164
catch (FbException)
165165
{
166-
logger.WriteError("Drop Database: Unknown firebird error when trying to access the server: {0}.", builder.DataSource);
166+
logger.LogError("Drop Database: Unknown firebird error when trying to access the server: {0}.", builder.DataSource);
167167
throw;
168168
}
169169
catch (Exception)
170170
{
171-
logger.WriteError("Drop Database: Unknown error when trying to access the server: {0}.", builder.DataSource);
171+
logger.LogError("Drop Database: Unknown error when trying to access the server: {0}.", builder.DataSource);
172172
throw;
173173
}
174174
}

src/dbup-firebird/FirebirdScriptExecutor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri
4747
}
4848
catch (FbException fbException)
4949
{
50-
Log().WriteInformation("Firebird exception has occured in script: '{0}'", script.Name);
51-
Log().WriteError("Script block number: {0}; Firebird error code: {1}; SQLSTATE {2}; Message: {3}", index, fbException.ErrorCode, fbException.SQLSTATE, fbException.Message);
52-
Log().WriteError(fbException.ToString());
50+
Log().LogInformation("Firebird exception has occured in script: '{0}'", script.Name);
51+
Log().LogError("Script block number: {0}; Firebird error code: {1}; SQLSTATE {2}; Message: {3}", index, fbException.ErrorCode, fbException.SQLSTATE, fbException.Message);
52+
Log().LogError(fbException.ToString());
5353
throw;
5454
}
5555
}

0 commit comments

Comments
 (0)