From 88863103d4d7b0e14749360110c42a02712fbe25 Mon Sep 17 00:00:00 2001 From: Minase Mekete Mengistu Date: Sun, 25 Dec 2022 22:24:48 +0300 Subject: [PATCH 1/2] Adds nuget pipeline yml --- .github/workflows/nuget.yml | 28 ++++++++++++++++++++++++++++ README.md | 18 +++++++++++++----- 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/nuget.yml diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml new file mode 100644 index 0000000..16cc231 --- /dev/null +++ b/.github/workflows/nuget.yml @@ -0,0 +1,28 @@ +name: "Deploy to nuget" +on: + push: + branches: + - "master" +env: + PROJECT_PATH: "PgBackup.csproj" + PACK_OUTPUT_DIR: ${{ github.workspace }}\output + NUGET_SOURCE_URL: https://www.nuget.org/packages/PgBackup.Net/1.0.0 +jobs: + deploy: + name: "deploy" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout" + uses: actions/checkout@v3 + - name: "Install dotnet standard" + uses: actions/setup-dotnet@v3 + with: + dotnet-version: "6.0" + - name: "Restore Packages" + run: dotnet restore ${{ env.PROJECT_PATH }} + - name: "Build Project" + run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release + - name: "Pack Project" + run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols --output ${{ env.PACK_OUTPUT_DIR }} + - name: "Push Package" + run: dotnet nuget push ${{ env.PACK_OUTPUT_DIR }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }} diff --git a/README.md b/README.md index 97f766d..447b6a7 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,38 @@ - # PostgreSQL backup -This package is a simple wrapper of postgresql's pg_dump client tool and can be used to take postgres database backups on demand from your .NET core or .NET framework applications. -Please refer https://www.postgresql.org/docs/current/libpq-pgpass.html for setting up the .pgpass file for the package to use to authentication to the database server, +This package is a simple wrapper of postgresql's pg_dump client tool and can be used to take postgres database backups on demand from a .NET core application. +Please refer https://www.postgresql.org/docs/current/libpq-pgpass.html for setting up the .pgpass file for the package to use to authentication to the database server, ## Installation Instructions + Nuget package available (https://www.nuget.org/packages/PgBackup.Net/1.0.0) + ``` Install-Package PgBackup.Net -Version 1.0.0 ``` + dotnet cli: + ``` dotnet add package PgBackup.Net --version=1.0.0 ``` + # Package usage + ## 1. Register the service in Startup.cs or Program.cs file + ``` services.AddPgBackupServices(); ``` -## 2. call the BackupDB method with path string(the storage location of the backup tar file) + +## 2. call the BackupDB method with path string(the storage location of the backup tar file) + ``` using PgBackup.Services; public class myClass { private readonly IPgDumpService _pgDumpService; - + public myClass(IPgDumpService pgDumpService) { _pgDumpService = pgDumpService; From 2a302f1f7e3c5575d9117dcf3c1b2ec9abd87085 Mon Sep 17 00:00:00 2001 From: Minase Mekete Mengistu Date: Sat, 29 Jul 2023 16:38:26 +0300 Subject: [PATCH 2/2] bugfix in Backup File Format --- Enums/Enums.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Enums/Enums.cs b/Enums/Enums.cs index 6c83e88..3bd6d90 100644 --- a/Enums/Enums.cs +++ b/Enums/Enums.cs @@ -6,6 +6,5 @@ public enum BackupFileFormat Tar, Directory, Custom - } } \ No newline at end of file