diff --git a/.github/workflows/release-nuget.yml b/.github/workflows/release-nuget.yml index bcfa88de..9aced2d5 100644 --- a/.github/workflows/release-nuget.yml +++ b/.github/workflows/release-nuget.yml @@ -15,18 +15,26 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3 with: - dotnet-version: 3.1.101 + dotnet-version: 3.1.x - name: Install dependencies run: dotnet restore src/Appium.Net.sln - name: Build run: | - if ("${{github.ref}}".trim() -notmatch '^refs/tags/v(\d+\.\d+\.\d+)$') { - exit 1 + if ("${{github.ref}}".trim() -notmatch '^refs\/tags\/v(((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$') { + Write-Host "Failed to find a tag with a value compatible with Sementic Versioning.\nEnsure the Sementic Versioning regex above matches the tag created for the release!"; exit 1 } - $version = $matches[1] - dotnet build src/Appium.Net.sln --no-restore --configuration Release -p:Version=$version + else { + $versionPrefix = $matches[2] + $dotnetBuildCmd = "dotnet build src/Appium.Net.sln --configuration Release -p:VersionPrefix=${versionPrefix}" + if ($matches.Count -eq 7) { + $versionSuffix = $matches[6] + $dotnetBuildCmd += " --version-suffix ${versionSuffix}" + } + } + Write-Host $dotnetBuildCmd + Invoke-Expression $dotnetBuildCmd - name: Deploy to nuget run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_DEPLOY_KEY }} --source https://api.nuget.org/v3/index.json diff --git a/src/Appium.Net/Appium.Net.csproj b/src/Appium.Net/Appium.Net.csproj index 2933d220..cf2b0bfe 100644 --- a/src/Appium.Net/Appium.Net.csproj +++ b/src/Appium.Net/Appium.Net.csproj @@ -1,14 +1,14 @@ - + - netstandard2.0;net48;net45 + netstandard2.0;net48 LICENSE.txt OpenQA.Selenium Appium Commiters Dotnet-Client false true - Copyright © 2022 + Copyright © 2023 https://github.com/appium/dotnet-client https://github.com/appium/dotnet-client git @@ -46,14 +46,6 @@ 1701;1702;1591 - - 1701;1702;1591 - - - - 1701;1702;1591 - - diff --git a/test/integration/Appium.Net.Integration.Tests.csproj b/test/integration/Appium.Net.Integration.Tests.csproj index e4c6d6f3..c462f1b2 100644 --- a/test/integration/Appium.Net.Integration.Tests.csproj +++ b/test/integration/Appium.Net.Integration.Tests.csproj @@ -1,6 +1,6 @@  - net48;net45 + net48