From 25f65fc45321032dd709ee29e2e3bc8e68c54fd7 Mon Sep 17 00:00:00 2001 From: Martin Boje Carpentier Date: Wed, 26 Jan 2022 21:48:00 +0100 Subject: [PATCH] Only .net core 3.1 is needed to build .net standard --- .github/workflows/release.yml | 26 ++++++++++++++------------ src/GeoJSON.Text.sln | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7056fb1..8367b22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,18 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v2 + - name: Validate release version + run: | + $VERSION=${env:GITHUB_REF_NAME} + if($VERSION[0] -eq "v"){ + $VERSION=$VERSION.substring(1) + } + if(!($VERSION -match ${env:NUGET_VERSIONING_REGEX})) { + throw "Release tag did not contain a valid NUGET version. TAG was : ${env:GITHUB_REF_NAME}" + } + echo "Version to use is - $VERSION" + echo "RELEASE_VERSION=$VERSION" | Out-File -FilePath ${env:GITHUB_ENV} -Append + - uses: actions/checkout@v2 - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: @@ -37,15 +48,6 @@ jobs: - name: Build solution run: dotnet build src/${{ env.PROJECT_NAME }}.sln -c Release --no-restore - name: Create Release NuGet package - run: | - $VERSION=${env:GITHUB_REF_NAME} - if($VERSION[0] -eq "v"){ - $VERSION=$VERSION.substring(1) - } - - if(!($VERSION -match ${env:NUGET_VERSIONING_REGEX})) { - throw "Release tag did not contain a valid NUGET version. TAG was : ${env:GITHUB_REF_NAME}" - } - dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj + run: dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=${{ env.RELEASE_VERSION }} -o nupkg src/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj - name: Push to Nuget - run: dotnet nuget push "./nupkg/${{ env.PROJECT_NAME }}.$VERSION.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}} --skip-duplicate + run: dotnet nuget push "./nupkg/${{ env.PROJECT_NAME }}.${{ env.RELEASE_VERSION }}.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}} --skip-duplicate diff --git a/src/GeoJSON.Text.sln b/src/GeoJSON.Text.sln index 1edb6f9..51d17e2 100644 --- a/src/GeoJSON.Text.sln +++ b/src/GeoJSON.Text.sln @@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\.github\workflows\continous-benchmark.yml = ..\.github\workflows\continous-benchmark.yml ..\LICENSE.md = ..\LICENSE.md ..\README.md = ..\README.md + ..\.github\workflows\release.yml = ..\.github\workflows\release.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoJSON.Text", "GeoJSON.Text\GeoJSON.Text.csproj", "{ECD95D99-8429-4358-92AE-1C51061D774C}"