-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "Deploy to NuGet" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
PROJECT_PATH: "src/Balance/SubsBase.SDK.Balance.csproj" | ||
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output | ||
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' | ||
|
||
jobs: | ||
deploy: | ||
name: 'Deploy' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Install dotnet' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '8.x' | ||
|
||
- name: 'Restore packages' | ||
run: dotnet restore ${{ env.PROJECT_PATH }} | ||
|
||
- name: 'Build project' | ||
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release | ||
|
||
- name: 'Get version' | ||
uses: kzrnm/[email protected] | ||
id: get-version | ||
with: | ||
proj-path: ${{ env.PROJECT_PATH }} | ||
|
||
- name: 'Get package name' | ||
id: get-package-name | ||
run: echo "::set-output name=package-name::SubsBaseBalance.${{ steps.get-version.outputs.version }}" | ||
|
||
- name: 'Pack project' | ||
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:PackageVersion=${{ steps.get-version.outputs.version }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} | ||
|
||
- name: 'Push package' | ||
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/${{ steps.get-package-name.outputs.package-name }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace SubsBase.SDK.Balance.Contracts; | ||
|
||
public class BalanceInfo | ||
{ | ||
public Guid Id { get; set; } | ||
public string Unit { get; set; } = string.Empty; | ||
public Dictionary<string, object>? Metadata { get; set; } | ||
|
||
public List<BalanceMovement>? BalanceMovements { get; set; } | ||
public List<BalanceDetails>? BalanceDetails { get; set; } | ||
public List<BalanceHold>? BalanceHolds { get; set; } | ||
} | ||
|
||
public class BalanceInfoNew | ||
{ | ||
public string Unit { get; set; } = string.Empty; | ||
public Dictionary<string, object>? Metadata { get; set; } | ||
[JsonPropertyName("allowTotalBalanceToBeNegative")] public bool AllowTotalBalanceToBeNegative { get; set; } = false; | ||
[JsonPropertyName("metadata")] public Dictionary<string, string>? Metadata { get; set; } | ||
[JsonPropertyName("unit")] public string Unit { get; set; } = string.Empty; | ||
} | ||
|
||
|
||
public class BalanceInfoUpdate | ||
{ | ||
public Dictionary<string, object>? Metadata { get; set; } | ||
[JsonPropertyName("metadata")] public Dictionary<string, object>? Metadata { get; set; } | ||
} | ||
|
||
public class BalanceSummary | ||
{ | ||
[JsonPropertyName("balanceId")] public Guid BalanceId { get; set; } | ||
[JsonPropertyName("totalAmount")] public decimal TotalAmount { get; set; } | ||
[JsonPropertyName("onHoldAmount")] public decimal OnHoldAmount { get; set; } | ||
[JsonPropertyName("availableAmount")] public decimal AvailableAmount { get; set; } | ||
} |