From 4a9bd2848d111a3b0e555b015c3356ffde6c2b66 Mon Sep 17 00:00:00 2001 From: Alex Davies Date: Sun, 21 Mar 2021 13:55:05 +0000 Subject: [PATCH] Include net5.0 into build Update build to use github actions --- .github/workflows/release.yaml | 22 +++++++++++++ .github/workflows/test.yaml | 30 +++++++++++++++++ MockHttpClient.sln | 10 ++++-- appveyor.yml | 33 ------------------- src/MockHttpClient/MockHttpClient.csproj | 16 +++------ .../MockHttpClient.Test.csproj | 6 +--- 6 files changed, 65 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/test.yaml delete mode 100644 appveyor.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c32e638 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: release +on: + push: + tags: + - 'v*' +jobs: + release: + + runs-on: ubuntu-latest + + steps: + - name: Set RELEASE_VERSION + run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}) #GITHUB_REF:11 skips first 11 characters of GITHUB_REF (GITHUB_REF will look like 'refs/tags/v*.*.*') + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* + - name: Pack + run: dotnet pack --output ./artifacts --configuration Release -p:Version=$RELEASE_VERSION + - name: Publish packages + run: dotnet nuget push ./artifacts/**.nupkg --source nuget.org --api-key ${{secrets.NUGET_TOKEN}} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..9150d38 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: test + +on: + pull_request: + branches: master + types: [synchronize, opened, reopened, ready_for_review, unlabeled] + paths-ignore: + - 'README.md' + push: + branches: master + paths-ignore: + - 'README.md' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.* + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/MockHttpClient.sln b/MockHttpClient.sln index f18f485..a5b33c7 100644 --- a/MockHttpClient.sln +++ b/MockHttpClient.sln @@ -1,12 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31112.23 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{192BC768-A7C9-42E6-8766-0CCC78B9C7F2}" ProjectSection(SolutionItems) = preProject - appveyor.yml = appveyor.yml README.md = README.md + .github\workflows\release.yaml = .github\workflows\release.yaml + .github\workflows\test.yaml = .github\workflows\test.yaml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7D67DA01-667D-411F-A222-1757A12ACFC7}" @@ -39,4 +40,7 @@ Global {DCC322E6-693C-4B5B-B7FE-3D3A3C9FB072} = {7D67DA01-667D-411F-A222-1757A12ACFC7} {AD86A4EA-5799-4101-8B09-9774BD31F0A7} = {8E8E7355-5E6A-447C-B20E-8E864BA736F4} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {908DC24D-C669-44B3-B06F-8C04563AF94F} + EndGlobalSection EndGlobal diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7ac2ca4..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: build.{build} -skip_tags: true -image: Visual Studio 2017 -configuration: Release -before_build: -- ps: >- - nuget restore - - - [xml]$proj = Get-Content src/MockHttpClient/MockHttpClient.csproj - - $semver = $proj.Project.PropertyGroup.Version[0].ToString() - - Set-AppveyorBuildVariable "semver" $semver - - Update-AppveyorBuild -Version "$semver-build.${env:APPVEYOR_BUILD_NUMBER}" -build: - verbosity: minimal -artifacts: -- path: src\MockHttpClient\bin\Release\MockHttpClient.*.*.*.nupkg - name: nupkg -deploy: -- provider: NuGet - api_key: - secure: 1VtoQkeVHGWnMyobYFPKUP9HRqllsKlEL3CJyZ58PH6U7RpKpTsqIHeJBv83iJuF - on: - branch: master -- provider: GitHub - tag: v$(semver) - auth_token: - secure: UfAp6rTXME04eu+jQR6jmm+DwiN0aVGkBZtaYqnyT6BanDVPMfT/WUGM0BU+fwVk - on: - branch: master \ No newline at end of file diff --git a/src/MockHttpClient/MockHttpClient.csproj b/src/MockHttpClient/MockHttpClient.csproj index e9a1ded..de06c6e 100644 --- a/src/MockHttpClient/MockHttpClient.csproj +++ b/src/MockHttpClient/MockHttpClient.csproj @@ -1,21 +1,15 @@  - netstandard1.4;net462 + netstandard1.4;net462;net5.0 True - 1.0.1 - Alex Davies + Alex Davies Codecutout Easily mock HttpClient with canned responses to make testing easier - https://github.com/codecutout/MockHttpClient/blob/master/LICENSE + https://github.com/codecutout/MockHttpClient/blob/master/LICENSE https://github.com/codecutout/MockHttpClient MockHttpClient Mock Fake HttpClient HttpMessageHandler - 1.0.1.0 - 1.0.1.0 - - - - true + true @@ -23,7 +17,7 @@ - + diff --git a/tests/MockHttpClient.Test/MockHttpClient.Test.csproj b/tests/MockHttpClient.Test/MockHttpClient.Test.csproj index 8a528b5..46b8ac0 100644 --- a/tests/MockHttpClient.Test/MockHttpClient.Test.csproj +++ b/tests/MockHttpClient.Test/MockHttpClient.Test.csproj @@ -1,7 +1,7 @@  - net462 + net5.0 @@ -18,8 +18,4 @@ - - - - \ No newline at end of file