From 0cf9fd6123cbd57f003d60ec8b51f1492a7858d9 Mon Sep 17 00:00:00 2001 From: Konstantin Diachenko Date: Sun, 26 Jan 2025 20:33:52 +0530 Subject: [PATCH 1/4] Fix https://github.com/linksplatform/Data.Doublets.Sequences/issues/33 --- .github/workflows/csharp.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 19ce60a..6cde062 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -32,7 +32,10 @@ jobs: - uses: actions/checkout@v1 with: submodules: true - - uses: nuget/setup-nuget@v1 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' - name: Publish NuGet package to GitHub Package Registry run: | dotnet build -c Release From 57dee7de41f3139e00c24cb777997afbecf52d68 Mon Sep 17 00:00:00 2001 From: Konstantin Diachenko Date: Sun, 26 Jan 2025 20:37:32 +0530 Subject: [PATCH 2/4] Fix https://github.com/linksplatform/Data.Doublets.Sequences/issues/33 --- .github/workflows/csharp.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 6cde062..0aeb023 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -36,12 +36,19 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - - name: Publish NuGet package to GitHub Package Registry + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Pack + run: dotnet pack --configuration Release --no-restore --output ./nupkgs + - name: Push NuGet package to GitHub Package Registry run: | - dotnet build -c Release - dotnet pack -c Release - nuget source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/linksplatform/index.json" -UserName linksplatform -Password ${{ secrets.GITHUB_TOKEN }} - nuget push **/*.nupkg -Source "GitHub" -SkipDuplicate + dotnet nuget push ./nupkgs/*.nupkg \ + --source "github" \ + --api-key "${{ secrets.GITHUB_TOKEN }}" + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} pusnToNuget: runs-on: ubuntu-latest needs: test From 04cf4082bbb55e7bb5ad5ddec66b3f0aecddb282 Mon Sep 17 00:00:00 2001 From: Konstantin Diachenko Date: Sun, 26 Jan 2025 20:42:00 +0530 Subject: [PATCH 3/4] Fix https://github.com/linksplatform/Data.Doublets.Sequences/issues/33 --- .github/workflows/csharp.yml | 53 ++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 0aeb023..6d39823 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -24,28 +24,59 @@ jobs: submodules: true - name: Test run: | - dotnet test -c Release -f net8 - pushNuGetPackageToGitHubPackageRegistry: - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - with: - submodules: true + dotnet test -c Release -f net8name: Publish NuGet Package + +on: + push: + branches: + - main + tags: + - 'v*.*.*' + +jobs: + pushNuGetPackageToGitHubPackageRegistry: + needs: test + runs-on: ubuntu-latest + steps: + # 1. Checkout the repository + - uses: actions/checkout@v3 + with: + submodules: true + + # 2. Setup .NET SDK - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' + dotnet-version: '8.0.x' # Specify your required .NET version + + # 3. Restore dependencies - name: Restore dependencies run: dotnet restore + + # 4. Build the project - name: Build run: dotnet build --configuration Release --no-restore + + # 5. Pack the project into a NuGet package - name: Pack run: dotnet pack --configuration Release --no-restore --output ./nupkgs - - name: Push NuGet package to GitHub Package Registry + + # 6. Add GitHub Package Registry as a NuGet source + - name: Add GitHub Package Registry as NuGet Source + run: | + dotnet nuget add source "https://nuget.pkg.github.com/linksplatform/index.json" \ + --name "GitHub" \ + --username "linksplatform" \ + --password "${{ secrets.GITHUB_TOKEN }}" \ + --store-password-in-clear-text + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # 7. Push the NuGet package to GitHub Package Registry + - name: Push NuGet Package to GitHub Package Registry run: | dotnet nuget push ./nupkgs/*.nupkg \ - --source "github" \ + --source "GitHub" \ --api-key "${{ secrets.GITHUB_TOKEN }}" env: NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8dddb3d9d3770c9436a32212b80ca0afac4fc8be Mon Sep 17 00:00:00 2001 From: Konstantin Diachenko Date: Sun, 26 Jan 2025 20:44:25 +0530 Subject: [PATCH 4/4] Fix #33 --- .github/workflows/csharp.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index 6d39823..df117d0 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -24,16 +24,7 @@ jobs: submodules: true - name: Test run: | - dotnet test -c Release -f net8name: Publish NuGet Package - -on: - push: - branches: - - main - tags: - - 'v*.*.*' - -jobs: + dotnet test -c Release -f net8 pushNuGetPackageToGitHubPackageRegistry: needs: test runs-on: ubuntu-latest