Skip to content

Commit df8a04b

Browse files
cternesalex-daviesAlex Davies
authored
update from master (#1)
* Include net5.0 into build (codecutout#5) Update build to use github actions Co-authored-by: Alex Davies <alex@codecutout.com> * Update release.yaml Set environment variable using the recommended approach Previous approach is deprecated due to security issues * Update release.yaml Use = instead of :: * Update release.yaml Set GeneratePackageOnBuild=false due to an issue where when true it does not build. dotnet/sdk#3473 (comment) Co-authored-by: Alex Davies <4279588+alex-davies@users.noreply.github.com> Co-authored-by: Alex Davies <alex@codecutout.com>
1 parent bc2c632 commit df8a04b

File tree

6 files changed

+65
-52
lines changed

6 files changed

+65
-52
lines changed

.github/workflows/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
release:
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Set RELEASE_VERSION
13+
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV #GITHUB_REF:11 skips first 11 characters of GITHUB_REF (GITHUB_REF will look like 'refs/tags/v*.*.*')
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 5.0.*
19+
- name: Pack
20+
run: dotnet pack --output ./artifacts --configuration Release -p:GeneratePackageOnBuild=false -p:Version=$RELEASE_VERSION
21+
- name: Publish packages
22+
run: dotnet nuget push ./artifacts/**.nupkg --source nuget.org --api-key ${{secrets.NUGET_TOKEN}}

.github/workflows/test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches: master
6+
types: [synchronize, opened, reopened, ready_for_review, unlabeled]
7+
paths-ignore:
8+
- 'README.md'
9+
push:
10+
branches: master
11+
paths-ignore:
12+
- 'README.md'
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v1
23+
with:
24+
dotnet-version: 5.0.*
25+
- name: Restore dependencies
26+
run: dotnet restore
27+
- name: Build
28+
run: dotnet build --no-restore
29+
- name: Test
30+
run: dotnet test --no-build --verbosity normal

MockHttpClient.sln

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.16
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31112.23
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{192BC768-A7C9-42E6-8766-0CCC78B9C7F2}"
77
ProjectSection(SolutionItems) = preProject
8-
appveyor.yml = appveyor.yml
98
README.md = README.md
9+
.github\workflows\release.yaml = .github\workflows\release.yaml
10+
.github\workflows\test.yaml = .github\workflows\test.yaml
1011
EndProjectSection
1112
EndProject
1213
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7D67DA01-667D-411F-A222-1757A12ACFC7}"
@@ -39,4 +40,7 @@ Global
3940
{DCC322E6-693C-4B5B-B7FE-3D3A3C9FB072} = {7D67DA01-667D-411F-A222-1757A12ACFC7}
4041
{AD86A4EA-5799-4101-8B09-9774BD31F0A7} = {8E8E7355-5E6A-447C-B20E-8E864BA736F4}
4142
EndGlobalSection
43+
GlobalSection(ExtensibilityGlobals) = postSolution
44+
SolutionGuid = {908DC24D-C669-44B3-B06F-8C04563AF94F}
45+
EndGlobalSection
4246
EndGlobal

appveyor.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/MockHttpClient/MockHttpClient.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.4;net462</TargetFrameworks>
4+
<TargetFrameworks>netstandard1.4;net462;net5.0</TargetFrameworks>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<Version>1.0.1</Version>
7-
<Authors>Alex Davies</Authors>
6+
<Authors>Alex Davies</Authors>
87
<Company>Codecutout</Company>
98
<Description>Easily mock HttpClient with canned responses to make testing easier</Description>
10-
<PackageLicenseUrl>https://github.com/codecutout/MockHttpClient/blob/master/LICENSE</PackageLicenseUrl>
9+
<License>https://github.com/codecutout/MockHttpClient/blob/master/LICENSE</License>
1110
<PackageProjectUrl>https://github.com/codecutout/MockHttpClient</PackageProjectUrl>
1211
<PackageTags>MockHttpClient Mock Fake HttpClient HttpMessageHandler</PackageTags>
13-
<AssemblyVersion>1.0.1.0</AssemblyVersion>
14-
<FileVersion>1.0.1.0</FileVersion>
15-
</PropertyGroup>
16-
17-
<PropertyGroup>
18-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
12+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1913
</PropertyGroup>
2014

2115
<ItemGroup>
2216
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
2317
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
2418
</ItemGroup>
2519

26-
<ItemGroup>
20+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
2721
<Reference Include="System.Net.Http" />
2822
</ItemGroup>
2923

tests/MockHttpClient.Test/MockHttpClient.Test.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net462</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -18,8 +18,4 @@
1818
<ProjectReference Include="..\..\src\MockHttpClient\MockHttpClient.csproj" />
1919
</ItemGroup>
2020

21-
<ItemGroup>
22-
<Reference Include="System.Net.Http" />
23-
</ItemGroup>
24-
2521
</Project>

0 commit comments

Comments
 (0)