Skip to content

Commit 6120ae1

Browse files
authored
Merge pull request #8 from Clifftech123/develop
Enhance tag verification step in CI/CD pipeline with informative mess…
2 parents 12d29bd + 91c7339 commit 6120ae1

8 files changed

Lines changed: 44 additions & 24 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
- name: Verify Git tags for MinVer
3737
run: |
3838
git fetch --tags --force
39-
git describe --tags
40-
git tag --points-at HEAD
39+
echo "Checking for tags..."
40+
git describe --tags 2>/dev/null || echo "No tags found yet - this is expected for first release"
41+
git tag --points-at HEAD || echo "No tag at current commit"
4142
4243
- name: Restore dependencies
4344
run: dotnet restore

Directory.Packages.props

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@
1010
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1111
</ItemGroup>
1212

13+
<!-- Core Libraries (for .NET Standard support) -->
14+
<ItemGroup>
15+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
16+
</ItemGroup>
17+
1318
<!-- Microsoft Extensions -->
1419
<ItemGroup>
1520
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
21+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
1622
</ItemGroup>
1723

1824
<!-- Testing Packages -->
1925
<ItemGroup>
20-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
21-
<PackageVersion Include="xunit" Version="2.9.2" />
22-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
23-
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
26+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
27+
<PackageVersion Include="xunit" Version="2.9.3" />
28+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
29+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
2430
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
2531
</ItemGroup>
2632

src/CountryData.Globalization.Hosting/CountryData.Globalization.Hosting.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Target Frameworks - Modern .NET -->
5-
<TargetFrameworks>netstandard2.1;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<!-- Target Frameworks - Broad compatibility (.NET Standard 2.0 works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin) -->
5+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -46,7 +46,8 @@ Initial release v1.0.0:
4646
- AddCountryData() extension method
4747
- Singleton lifetime management for ICountryDataProvider
4848
- Full ASP.NET Core integration support
49-
- Multi-framework support (.NET Standard 2.1, .NET 8-10)
49+
- Multi-framework support (.NET Standard 2.0+, .NET 6, 8, 10)
50+
- Works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin
5051
</PackageReleaseNotes>
5152

5253
<!-- Package Icon (uncomment when you add an icon) -->

src/CountryData.Globalization/CountryData.Globalization.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Target Frameworks - Modern .NET -->
5-
<TargetFrameworks>netstandard2.1;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<!-- Target Frameworks - Broad compatibility (.NET Standard 2.0 works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin) -->
5+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -49,8 +49,9 @@ Initial release v1.0.0:
4949
- Full CultureInfo and RegionInfo integration
5050
- O(1) dictionary lookups with lazy-loaded caches
5151
- Thread-safe operations with immutable data collections
52-
- Zero external dependencies
53-
- Multi-framework support (.NET Standard 2.1, .NET 8-10)
52+
- Minimal external dependencies (only System.Text.Json)
53+
- Multi-framework support (.NET Standard 2.0+, .NET 6, 8, 10)
54+
- Works with .NET Framework 4.6.1+, .NET Core 2.0+, Unity, Xamarin
5455
- Built-in dependency injection support via CountryData.Globalization.Hosting package
5556
</PackageReleaseNotes>
5657

@@ -97,6 +98,7 @@ Initial release v1.0.0:
9798

9899
<!-- Package References from Central Package Management -->
99100
<ItemGroup>
101+
<PackageReference Include="System.Text.Json" />
100102
<PackageReference Include="MinVer" PrivateAssets="All" />
101103
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
102104
</ItemGroup>

src/CountryData.Globalization/Models/Country.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
{
33
/// <summary>
44
/// Represents a country with its associated data including ISO codes, names, phone codes, regions, and Unicode emoji flag.
5-
///
5+
///
66
/// </summary>
77
public class Country
88
{
99
/// <summary>
1010
/// Gets or sets the full country name (e.g., "United States", "Canada", "Japan").
1111
/// </summary>
12-
public required string CountryName { get; set; }
12+
public string CountryName { get; set; } = string.Empty;
1313

1414
/// <summary>
1515
/// Gets or sets the international phone code for the country (e.g., "+1", "+44", "+81").
1616
/// </summary>
17-
public required string PhoneCode { get; set; }
17+
public string PhoneCode { get; set; } = string.Empty;
1818

1919
/// <summary>
2020
/// Gets or sets the ISO 3166-1 alpha-2 country code (e.g., "US", "CA", "JP").
2121
/// </summary>
22-
public required string CountryShortCode { get; set; }
22+
public string CountryShortCode { get; set; } = string.Empty;
2323

2424
/// <summary>
2525
/// Gets or sets the Unicode emoji flag representing the country (e.g., "🇺🇸", "🇨🇦", "🇯🇵").

src/CountryData.Globalization/Models/Region.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class Region
88
/// <summary>
99
/// Gets or sets the full region name (e.g., "California", "Ontario", "Tokyo").
1010
/// </summary>
11-
public required string Name { get; set; }
11+
public string Name { get; set; } = string.Empty;
1212

1313
/// <summary>
1414
/// Gets or sets the region short code (e.g., "CA", "ON", "13").

src/CountryData.Globalization/Services/CountryDataProvider.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,17 @@ public IEnumerable<CultureInfo> GetAllCulturesForCountry(string shortCode)
373373
try
374374
{
375375
var cultureName = $"{languageCode}-{shortCode}";
376-
return CultureInfo.GetCultureInfo(cultureName);
376+
var culture = CultureInfo.GetCultureInfo(cultureName);
377+
378+
// Validate that the culture actually exists in the system
379+
// This ensures consistent behavior across Windows/Linux
380+
var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
381+
if (!allCultures.Any(c => c.Name.Equals(cultureName, StringComparison.OrdinalIgnoreCase)))
382+
{
383+
return null;
384+
}
385+
386+
return culture;
377387
}
378388
catch
379389
{

tests/CountryData.Globalization.Tests/CountryData.Globalization.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="coverlet.collector" Version="6.0.4" />
12-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
14-
<PackageReference Include="xunit" Version="2.9.3" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
11+
<PackageReference Include="coverlet.collector" />
12+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
14+
<PackageReference Include="xunit" />
15+
<PackageReference Include="xunit.runner.visualstudio" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

0 commit comments

Comments
 (0)