Skip to content

Commit 60f27b9

Browse files
Merge pull request #54 from IowaComputerGurus/feature/ci-updates
Update to GitHub Actions
2 parents d230099 + 9e37b78 commit 60f27b9

File tree

5 files changed

+58
-16
lines changed

5 files changed

+58
-16
lines changed

.github/workflows/ci-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
name: Build and Publish
13+
name: Validate Build
1414
env:
1515
solution-path: './src/ICG AspnetCore Utilities.sln'
1616
steps:

.github/workflows/release-build.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
name: Build & Publish to NuGet
12+
environment: nuget
13+
env:
14+
solution-path: './src/ICG AspnetCore Utilities.sln'
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Ensure .NET Installed
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: 5.0.x
24+
25+
- name: Install GitVersion
26+
run: dotnet tool install --global GitVersion.Tool
27+
28+
- name: Determine Version
29+
id: gitversion
30+
uses: gittools/actions/gitversion/[email protected]
31+
with:
32+
useConfigFile: true
33+
34+
- name: Restore Packages
35+
run: dotnet restore "${{ env.solution-path }}"
36+
- name: Build
37+
run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
38+
- name: Test
39+
run: dotnet test "${{ env.solution-path }}" --no-build --configuration Release
40+
41+
- name: Publish
42+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.ICG_NUGET_API_KEY}}

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# aspnetcore.utilities ![](https://img.shields.io/github/license/iowacomputergurus/aspnetcore.utilities.svg)
2-
| Master | Develop |
3-
| --- | --- |
4-
| ![Master Branch Status](https://iowacomputergurus.visualstudio.com/ICG%20Open%20Source/_apis/build/status/AspNetCore%20Utilities?branchName=master) | ![Development Branch Status](https://iowacomputergurus.visualstudio.com/ICG%20Open%20Source/_apis/build/status/AspNetCore%20Utilities?branchName=development) |
52

6-
## NuGet Package Information
7-
ICG.AspNetCore.Utilities ![](https://img.shields.io/nuget/v/icg.aspnetcore.utilities.svg) ![](https://img.shields.io/nuget/dt/icg.aspnetcore.utilities.svg)
3+
![Build Status](https://github.com/IowaComputerGurus/aspnetcore.utilities/actions/workflows/ci-build.yml/badge.svg)
4+
5+
![](https://img.shields.io/nuget/v/icg.aspnetcore.utilities.svg) ![](https://img.shields.io/nuget/dt/icg.aspnetcore.utilities.svg)
86

97

108
A collection of helpful utilities for working with ASP.NET Core projects. These items are common rules, tag helpers and similar that our team has found valuable.
@@ -19,16 +17,16 @@ A number of elements have been moved to the sister netcore project.
1917

2018
Install from NuGet
2119

22-
```
20+
``` powershell
2321
Install-Package ICG.AspNetCore.Utilities
2422
```
2523

2624
### Register Dependencies
2725

2826
To utilize the tag helpers modify `_viewimports.cshtml` by adding
2927

30-
```
31-
@addTagHelper *, ICG.AspNetCore.Utilities
28+
``` html+razor
29+
@addTagHelper *, AspNetCore.Utilities
3230
```
3331

3432
**Caution:** As expected the use of both ForceNonWwwRewriteRule and ForceWwwRewriteRule in the same installation will result in broken sites.
@@ -38,7 +36,7 @@ To utilize the tag helpers modify `_viewimports.cshtml` by adding
3836
#### HideCondition
3937
This tag helper will hide the content of the target element if the condition is true, an example.
4038

41-
```
39+
``` html
4240
<div hide-condition="Model.Deleted">
4341

4442
</div>
@@ -47,7 +45,7 @@ This tag helper will hide the content of the target element if the condition is
4745
#### Show Condition
4846
This tag helper will show the content of the target element if the condition is true, an example.
4947

50-
```
48+
``` html
5149
<div show-condition="Model.Published">
5250

5351
</div>

src/AspNetCore.Utilities.Tests/AspNetCore.Utilities.Tests.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
12-
<PackageReference Include="Moq" Version="4.12.0" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
12+
<PackageReference Include="Moq" Version="4.16.1" />
1313
<PackageReference Include="xunit" Version="2.4.1" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>

src/AspNetCore.Utilities/AspNetCore.Utilities.csproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<TargetFramework>net5.0</TargetFramework>
99
<RootNamespace>ICG.AspNetCore.Utilities</RootNamespace>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1112
<ApplicationIcon />
1213
<OutputType>Library</OutputType>
1314
<StartupObject />
@@ -31,7 +32,7 @@
3132
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3233
</PropertyGroup>
3334

34-
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
35+
<PropertyGroup Condition="'$GITHUB_ACTIONS)' == 'true'">
3536
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3637
</PropertyGroup>
3738

@@ -43,7 +44,8 @@
4344
</ItemGroup>
4445

4546
<ItemGroup>
46-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0-preview7.19362.4" />
47+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
48+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
4749
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
4850
<PrivateAssets>all</PrivateAssets>
4951
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)