From 262be68a732d1164a410536138671b7537b55b1d Mon Sep 17 00:00:00 2001 From: Laolu Benson Date: Thu, 14 Jan 2021 17:25:10 +0000 Subject: [PATCH 1/2] build: re-enable GeneratePackageOnBuild for GithubAction --- src/Appium.Net/Appium.Net.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appium.Net/Appium.Net.csproj b/src/Appium.Net/Appium.Net.csproj index 757667bc..67564fe2 100644 --- a/src/Appium.Net/Appium.Net.csproj +++ b/src/Appium.Net/Appium.Net.csproj @@ -7,7 +7,7 @@ Appium Commiters Appium-Dotnet-Driver false - false + true Copyright © 2020 https://github.com/appium/appium-dotnet-driver https://github.com/appium/appium-dotnet-driver From a00d3cba70775eebd99468b487c68e84897b6a0d Mon Sep 17 00:00:00 2001 From: Laolu Benson Date: Sat, 7 Jan 2023 19:07:54 +0000 Subject: [PATCH 2/2] chore: update nuget build and deploy github action to support semantic versioning 2.0 --- .github/workflows/release-nuget.yml | 18 +++++++++++++----- src/Appium.Net/Appium.Net.csproj | 7 ++----- .../Appium.Net.Integration.Tests.csproj | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) 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 d1a29858..c7a4a5ee 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 @@ -32,9 +32,6 @@ Appium.Net.xml - - Appium.Net.xml - 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