diff --git a/.github/workflows/build-action/action.yml b/.github/workflows/build-action/action.yml new file mode 100644 index 0000000..0b187f7 --- /dev/null +++ b/.github/workflows/build-action/action.yml @@ -0,0 +1,18 @@ +name: "Build and Test Solution" +description: "Checks out the repository and does something" +runs: + using: "composite" + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + shell: bash + run: dotnet restore + - name: Build + shell: bash + run: dotnet build --no-restore + - name: Test + shell: bash + run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..82063d7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: "Build & Test" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - uses: ./.github/workflows/build-action diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5fa9349 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: "Publish to nuget.org" + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - uses: ./.github/workflows/build-action + - name: Create Version + run: echo "VERSION=$(grep -oPm1 "(?<=)[^<]+" ./Directory.Build.props)" >> $GITHUB_ENV + - name: Print Version + run: echo ${{ env.VERSION }} + - if: ${{startsWith(github.event.ref, 'refs/tags/v')}} + name: Publish Release NuGet + run: | + dotnet build -c Release + dotnet pack -c Release /p:Version=${{ env.VERSION }}.${{ github.run_number }} /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}" + dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate + - if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }} + name: Publish Prerelease NuGet + run: | + dotnet pack -c Debug /p:Version=${{ env.VERSION }}.${{ github.run_number }}-prerelease /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}" + dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}-prerelease.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3970f23..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: csharp -mono: none -dotnet: 3.1.410 -solution: DvelopSdk.sln -script: -- dotnet restore -- bash travis/deploy.sh -env: - global: - - secure: KLvAX1OOfNYxr4lKIxrbqnxs02+0d7ruoZECdmKpxBYbTUCrnL/w8QSCFZPJz9L0sgqT5lRq+Yrhup4vE8iIp3LrMpv8stjFKH2yTVhOw82kDkzuwiOu8gnjZOXp6U6GhAEuJ7CAaFjrlQFEOHNH8TTwHANChlJhYcC1jYf8merv/L75QbXRJLenvdkQwfRvpbI4Cwp1CJMXlmXZ8ueNq9PmIn0rwlS4wdGQwAzS19BD82ekzZ1aTwIoqGnxu83HJtj6oZ3xyW47lWtdMMZh9HY4lOhEyfDG4V9Vs1dK0leLMINc9yE4ECCOCkKeyKjhc0LyPB1LrBRw/ypRkdun7QxP7cxdD652XvbHdC64sp7dqDBS3Xtq+rR8bSHVLDNiCby5Q4KK/BcPXiaE7VWXEmwkHPWAN9ptqP60/m75D6fKyfBW90HaQL1HYG0oaF4FKqwpCBnvw9OgX3+S1lYcuNDcHvKNegasFEghbC9D2NOkVrgH99rJS03mqqRvVKxUHZE/OMIj28ekeY802qvFfu6pqEJPrB6W7lYVJ722yp0KTLlQMPko2PaXWKKe85GhHQNsOJKx+LG4YMKIY6tI81N3KMnnNu8YouaWld+OM1KTjksQu9xqQ/Up6GrK+MkLSIgw8Ff3K0UbCZMGj9jBUTVi4/VqcTau/z1KtyyVx8U= diff --git a/Directory.Build.props b/Directory.Build.props index 29c3025..c351f9f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,6 @@ d.velop AG Copyright (c) 2021 https://github.com/d-velop/dvelop-sdk-cs - 0.0.7 + 0.0.8 diff --git a/dvelop-sdk-httpclientextensions/HttpClientExtensions.UnitTest/HttpClientExtensions.UnitTest.csproj b/dvelop-sdk-httpclientextensions/HttpClientExtensions.UnitTest/HttpClientExtensions.UnitTest.csproj index 58f57bf..2f405dd 100644 --- a/dvelop-sdk-httpclientextensions/HttpClientExtensions.UnitTest/HttpClientExtensions.UnitTest.csproj +++ b/dvelop-sdk-httpclientextensions/HttpClientExtensions.UnitTest/HttpClientExtensions.UnitTest.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false Dvelop.Sdk.HttpClientExtensions.UnitTest Dvelop.Sdk.HttpClientExtensions.UnitTest diff --git a/dvelop-sdk-identityprovider/IdentityProviderMiddleware.UnitTest/IdentityProviderMiddleware.UnitTest.csproj b/dvelop-sdk-identityprovider/IdentityProviderMiddleware.UnitTest/IdentityProviderMiddleware.UnitTest.csproj index 93f7dff..c4a2959 100644 --- a/dvelop-sdk-identityprovider/IdentityProviderMiddleware.UnitTest/IdentityProviderMiddleware.UnitTest.csproj +++ b/dvelop-sdk-identityprovider/IdentityProviderMiddleware.UnitTest/IdentityProviderMiddleware.UnitTest.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 false Dvelop.Sdk.IdentityProviderMiddleware.UnitTest Dvelop.Sdk.IdentityProviderMiddleware.UnitTest diff --git a/dvelop-sdk-signing/SigningAlgorithms.UnitTest/SigningAlgorithms.UnitTest.csproj b/dvelop-sdk-signing/SigningAlgorithms.UnitTest/SigningAlgorithms.UnitTest.csproj index 22942b7..f9e719d 100644 --- a/dvelop-sdk-signing/SigningAlgorithms.UnitTest/SigningAlgorithms.UnitTest.csproj +++ b/dvelop-sdk-signing/SigningAlgorithms.UnitTest/SigningAlgorithms.UnitTest.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false Dvelop.Sdk.SigningAlgorithms.UnitTest Dvelop.Sdk.SigningAlgorithms.UnitTest diff --git a/dvelop-sdk-tenant/TenantMiddleware.UnitTest/TenantMiddleware.UnitTest.csproj b/dvelop-sdk-tenant/TenantMiddleware.UnitTest/TenantMiddleware.UnitTest.csproj index 6624bdd..7ae5a03 100644 --- a/dvelop-sdk-tenant/TenantMiddleware.UnitTest/TenantMiddleware.UnitTest.csproj +++ b/dvelop-sdk-tenant/TenantMiddleware.UnitTest/TenantMiddleware.UnitTest.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 false Dvelop.Sdk.TenantMiddleware.UnitTest Dvelop.Sdk.TenantMiddleware.UnitTest diff --git a/dvelop-sdk-webapi/WebApiExtensions.UnitTest/WebApiExtensions.UnitTest.csproj b/dvelop-sdk-webapi/WebApiExtensions.UnitTest/WebApiExtensions.UnitTest.csproj index c48084e..84d7a36 100644 --- a/dvelop-sdk-webapi/WebApiExtensions.UnitTest/WebApiExtensions.UnitTest.csproj +++ b/dvelop-sdk-webapi/WebApiExtensions.UnitTest/WebApiExtensions.UnitTest.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/travis/deploy.sh b/travis/deploy.sh deleted file mode 100644 index 928f7b8..0000000 --- a/travis/deploy.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -euo pipefail -# http://redsymbol.net/articles/unofficial-bash-strict-mode/ - -export VERSION=$(grep -oPm1 "(?<=)[^<]+" Directory.Build.props) - -echo ${TRAVIS_BUILD_NUMBER} - -echo "clean" -dotnet clean - -echo "test" -dotnet test --logger:"console;verbosity=normal" - -if [[ ${TRAVIS_PULL_REQUEST} == 'false' ]]; then - -echo "build" - - - if [[ ! -z ${TRAVIS_TAG} ]]; then - echo "pack release" - dotnet build -c Release - dotnet pack -c Release /p:Version=${VERSION}.${TRAVIS_BUILD_NUMBER} /p:InformationalVersion="$VERSION+$TRAVIS_BRANCH/$TRAVIS_COMMIT" - echo "push" - find . -name "*.$VERSION.$TRAVIS_BUILD_NUMBER.nupkg" | xargs -i dotnet nuget push {} -s https://api.nuget.org/v3/index.json -k ${NUGET_API_KEY} - else - echo "pack prerelease" - dotnet build -c Debug - if [[ ${TRAVIS_BRANCH} == 'main' ]]; then - dotnet pack -c Debug /p:Version=${VERSION}.${TRAVIS_BUILD_NUMBER}-prerelease /p:InformationalVersion="$VERSION+$TRAVIS_BRANCH/$TRAVIS_COMMIT" - echo "push" - find . -name "*.$VERSION.$TRAVIS_BUILD_NUMBER-prerelease.nupkg" | xargs -i dotnet nuget push {} -s https://api.nuget.org/v3/index.json -k ${NUGET_API_KEY} - fi - fi -fi -echo "return code: $?" \ No newline at end of file