Skip to content

Commit e932c9a

Browse files
committed
Fixing build versions
1 parent 4282169 commit e932c9a

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.github/workflows/dotnet-workflow.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
msbuild -version
3131
msbuild "./AuthorizeNET.sln" -property:Configuration=Release -t:rebuild
3232
Write-Output "Build Successful"
33+
nuget pack AuthorizeNet.nuspec
34+
35+
- name: Upload Rest Client SDK Nupkg
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: sdk-nupkg
39+
path: ${{env.sdk_dotnet}}/*.nupkg
3340

3441
- name: Run UnitTests
3542
uses: josepho0918/vstest-action@main
@@ -61,10 +68,17 @@ jobs:
6168
needs: workflow-job-build
6269
runs-on: ${{matrix.operating-system}}
6370
steps:
71+
- name: Download the Built Rest Client for Dotnet from previous Job
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: sdk-nupkg
75+
path: sdk-nupkg
76+
6477
- name: Recreate SDK Folder structure
6578
shell: pwsh
6679
run: |
6780
If(!(Test-Path -PathType container "${{env.sdk_dotnet}}/Authorize.NET/bin/Release")) { md ${{env.sdk_dotnet}}/Authorize.NET/bin/Release }
81+
6882
- name: Download the SDK from previous job
6983
uses: actions/download-artifact@v4
7084
with:
@@ -84,18 +98,25 @@ jobs:
8498
- name: Compile the Sample Application
8599
shell: pwsh
86100
run: |
101+
$clientSdkFolderName = (Get-ChildItem -Path sdk-nupkg -Filter "*nupkg" | Select-Object -First 1).BaseName
102+
$clientSdkVersion = $clientSdkFolderName.Substring(13)
103+
nuget Sources Add -Name "temperory_nuget_source" -Source ((Get-Location).Path + "\sdk-nupkg")
104+
87105
cd $Env:sample_code_csharp
88-
nuget install ./packages.config -OutputDirectory packages
89-
nuget install ./SampleCodeTest/packages.config -OutputDirectory packages
90-
91-
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>..\\sdk-dotnet\\Authorize.NET\\bin\\Release\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCode.csproj
92-
93-
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>..\\..\\sdk-dotnet\\Authorize.NET\\bin\\Release\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
106+
(Get-Content ./packages.config) | ForEach-Object { $_ -replace '.*<package\s*id="AuthorizeNet".*\/>', "<package id=`"AuthorizeNet`" version=`"$clientSdkVersion`" targetFramework=`"net461`" />" } | Set-Content ./packages.config
107+
(Get-Content ./packages.config) | ForEach-Object { $_ -replace '.*<package\s*id="AuthorizeNet".*\/>', "<package id=`"AuthorizeNet`" version=`"$clientSdkVersion`" targetFramework=`"net461`" />" } | Set-Content ./packages.config
108+
109+
nuget install ./packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
110+
nuget install ./SampleCodeTest/packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
111+
112+
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCode.csproj
113+
114+
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
94115
95116
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCode.csproj
96117
97118
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
98-
119+
99120
msbuild -version
100121
msbuild "./SampleCode.sln" -property:Configuration=Debug -t:rebuild
101122
Write-Output "Build Successful"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy