File tree Expand file tree Collapse file tree 5 files changed +87
-7
lines changed Expand file tree Collapse file tree 5 files changed +87
-7
lines changed Original file line number Diff line number Diff line change 17
17
- uses : actions/setup-dotnet@v4
18
18
with :
19
19
global-json-file : ' ./global.json'
20
- - run : dotnet --version
21
- - name : Build
22
- run : dotnet build
23
- - name : Test
24
- run : dotnet test --no-build
20
+ - name : Build and Test
21
+ run : ./scripts/Build.ps1
22
+ shell : pwsh
Original file line number Diff line number Diff line change
1
+ name : ' RELEASE'
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ tags :
8
+ - ' *.*.*'
9
+ jobs :
10
+ build-and-push :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+ with :
15
+ fetch-depth : 0
16
+ - uses : actions/setup-dotnet@v4
17
+ with :
18
+ global-json-file : ' ./global.json'
19
+ - name : Build and Test
20
+ run : ./scripts/Build.ps1
21
+ shell : pwsh
22
+ - name : Push to NuGet
23
+ env :
24
+ NUGET_URL : https://api.nuget.org/v3/index.json
25
+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
26
+ run : ./Push.ps1
27
+ shell : pwsh
28
+ - name : Artifacts
29
+ uses : actions/upload-artifact@v4
30
+ with :
31
+ name : artifacts
32
+ path : artifacts/**/*
Original file line number Diff line number Diff line change
1
+ # Taken from psake https://github.com/psake/psake
2
+
3
+ <#
4
+ . SYNOPSIS
5
+ This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
6
+ to see if an error occcured. If an error is detected then an exception is thrown.
7
+ This function allows you to run command-line programs without having to
8
+ explicitly check the $lastexitcode variable.
9
+ . EXAMPLE
10
+ exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
11
+ #>
12
+ function Exec
13
+ {
14
+ [CmdletBinding ()]
15
+ param (
16
+ [Parameter (Position = 0 , Mandatory = 1 )][scriptblock ]$cmd ,
17
+ [Parameter (Position = 1 , Mandatory = 0 )][string ]$errorMessage = ($msgs.error_bad_command -f $cmd )
18
+ )
19
+ & $cmd
20
+ if ($lastexitcode -ne 0 ) {
21
+ throw (" Exec: " + $errorMessage )
22
+ }
23
+ }
24
+
25
+ $artifacts = " .\artifacts"
26
+
27
+ if (Test-Path $artifacts ) { Remove-Item $artifacts - Force - Recurse }
28
+
29
+ exec { & dotnet clean - c Release }
30
+
31
+ exec { & dotnet build - c Release }
32
+
33
+ exec { & dotnet test - c Release -- no- build - l trx -- verbosity= normal }
34
+
35
+ exec { & dotnet pack .\src\Axepta.SDK\Axepta.SDK.csproj - c Release - o $artifacts -- no- build }
Original file line number Diff line number Diff line change
1
+ $scriptName = $MyInvocation.MyCommand.Name
2
+ $artifacts = " ./artifacts"
3
+
4
+ if ([string ]::IsNullOrEmpty($Env: NUGET_API_KEY )) {
5
+ Write-Host " ${scriptName} : NUGET_API_KEY is empty or not set. Skipped pushing package(s)."
6
+ } else {
7
+ Get-ChildItem $artifacts - Filter " *.nupkg" | ForEach-Object {
8
+ Write-Host " $ ( $scriptName ) : Pushing $ ( $_.Name ) "
9
+ dotnet nuget push $_ -- source $Env: NUGET_URL -- api- key $Env: NUGET_API_KEY
10
+ if ($lastexitcode -ne 0 ) {
11
+ throw (" Exec: " + $errorMessage )
12
+ }
13
+ }
14
+ }
Original file line number Diff line number Diff line change 5
5
<ImplicitUsings >enable</ImplicitUsings >
6
6
<Nullable >enable</Nullable >
7
7
<PackageId >Axepta.SDK</PackageId >
8
- <VersionPrefix >1.0.5</VersionPrefix >
9
8
<Authors >Maksymilian Szokalski</Authors >
9
+ <Copyright >Copyright Maksymilian Szokalski</Copyright >
10
10
<Description >Axepta.SDK is a class library for BNP Paribas Axepta Paywall</Description >
11
- <PackageTags >BNP Paribas;Axepta;Paywall;Payments;Transactions</PackageTags >
11
+ <PackageTags >bnp paribas;axepta;paywall;payments;transactions</PackageTags >
12
+ <MinVerTagPrefix >v</MinVerTagPrefix >
12
13
<RepositoryUrl >https://github.com/illunix/Axepta.SDK</RepositoryUrl >
13
14
<PackageProjectUrl >https://github.com/illunix/Axepta.SDK</PackageProjectUrl >
14
15
<PackageIcon >AxeptaLogo.png</PackageIcon >
You can’t perform that action at this time.
0 commit comments