Skip to content

Commit

Permalink
Update projects and add CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Oct 31, 2022
1 parent 589eeb7 commit 63a9a2e
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 8 deletions.
File renamed without changes.
32 changes: 32 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on:
push:
branches:
- main
pull_request:

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1

jobs:
build:
name: Build
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Restore
run: dotnet restore --nologo

- name: Run Data Builder
run: dotnet run --project src/TimeZoneNames.DataBuilder -c Release --nologo --no-restore

- name: Build Solution
run: dotnet build -c Release --nologo --no-restore

- name: Test
run: dotnet test -c Release --nologo --no-build -l GitHubActions -l "trx;LogFileName=testresults.trx"
38 changes: 38 additions & 0 deletions .github/workflows/pack-for-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: pack-for-release

on:
workflow_dispatch:

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1

jobs:
build-and-pack:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Restore
run: dotnet restore --nologo

- name: Run Data Builder
run: dotnet run --project src/TimeZoneNames.DataBuilder -c Release --nologo --no-restore

- name: Build Solution
run: dotnet build -c Release --nologo --no-restore

- name: Test
run: dotnet test -c Release --nologo --no-build -l GitHubActions -l "trx;LogFileName=testresults.trx"

- name: Pack
run: dotnet pack -c Release --nologo --no-build

- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: src/**/Release/*.*nupkg
if-no-files-found: error
18 changes: 18 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>

<PropertyGroup>
<LangVersion>10</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="4.1.1" PrivateAssets="All" />
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="All" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<Using Remove="System.Net.Http" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<LangVersion>10</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 8 additions & 4 deletions src/TimeZoneNames/TimeZoneNames.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
<Description>Provides localized time zone names.</Description>
<Authors>Matt Johnson-Pint</Authors>
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0;net462</TargetFrameworks>
<LangVersion>10</LangVersion>
<PackageId>TimeZoneNames</PackageId>
<PackageTags>timezone;time;zone;time zone;iana;tzdb;olson;timezoneinfo;globalization;international;localization</PackageTags>
<PackageProjectUrl>https://github.com/mattjohnsonpint/TimeZoneNames</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>6.0.0</Version>
<Trimmable>true</Trimmable>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyOriginatorKeyFile>mj1856_oss.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\.assets\mattjohnsonpint.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<Trimmable>true</Trimmable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup>
Expand All @@ -25,6 +28,7 @@

<ItemGroup>
<PackageReference Include="TimeZoneConverter" Version="6.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
Expand Down
5 changes: 2 additions & 3 deletions test/TimeZoneNames.Tests/TimeZoneNames.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1;net48</TargetFrameworks>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -25,8 +24,8 @@
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageReference Include="System.Collections.Immutable" Version="6.0.0" />
<ItemGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
</ItemGroup>

</Project>

0 comments on commit 63a9a2e

Please sign in to comment.