From 496a6c4e94104f494acb48c2e6d98102910ac4c7 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:00:55 +0100 Subject: [PATCH 01/43] Create PublishNugate.yml --- .github/workflows/PublishNugate.yml | 119 ++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 .github/workflows/PublishNugate.yml diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml new file mode 100644 index 0000000..c159778 --- /dev/null +++ b/.github/workflows/PublishNugate.yml @@ -0,0 +1,119 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: publish +on: + workflow_dispatch: # Allow running the workflow manually from the GitHub UI + push: + branches: + - 'main' # Run the workflow when pushing to the main branch + pull_request: + branches: + - '*' # Run the workflow for all pull requests + release: + types: + - published # Run the workflow when a new GitHub release is published + +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: true + NuGetDirectory: ${{ github.workspace }}/nuget + +defaults: + run: + shell: pwsh + +jobs: + create_nuget: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Get all history to allow automatic versioning using MinVer + + # Install the .NET SDK indicated in the global.json file + - name: Setup .NET + uses: actions/setup-dotnet@v4 + + - name: Find project path + id: find-path + run: | + # Search for a specific project file (e.g., *.csproj for a C# project) + PROJECT_PATH=$(find . -name "*AzureDevopsWebhookService.Contracts.csproj") + echo "Project path found: $PROJECT_PATH" + + # Save the project path as an output variable + echo "::set-output name=project_path::$PROJECT_PATH" + + - name: Set NuGet directory + run: echo "NuGetDirectory=$HOME/.nuget/packages" >> $GITHUB_ENV + + # Create the NuGet package in the folder from the environment variable NuGetDirectory + - name: Pack project + run: dotnet pack ${{ steps.find-path.outputs.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} + # Publish the NuGet package as an artifact, so they can be used in the following jobs + - uses: actions/upload-artifact@v3 + with: + name: nuget + if-no-files-found: error + retention-days: 7 + path: ${{ env.NuGetDirectory }}/*.nupkg + + validate_nuget: + runs-on: ubuntu-latest + needs: [ create_nuget ] + steps: + # Install the .NET SDK indicated in the global.json file + - name: Setup .NET + uses: actions/setup-dotnet@v4 + + # Download the NuGet package created in the previous job + - uses: actions/download-artifact@v3 + with: + name: nuget + path: ${{ env.NuGetDirectory }} + + - name: Install nuget validator + run: dotnet tool update TunetCom.NuGetPackageValidation.Tool --global + + # Validate metadata and content of the NuGet package + # https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab + # If some rules are not applicable, you can disable them + # using the --excluded-rules or --excluded-rule-ids option + - name: Validate package + run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg") + + run_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + - name: Run tests + run: dotnet test path/to/YourClassLibrary.Tests.csproj --configuration Release + + deploy: + # Publish only when creating a GitHub Release + # https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository + # You can update this logic if you want to manage releases differently + if: github.event_name == 'push' + runs-on: ubuntu-latest + needs: [ validate_nuget, run_test ] + steps: + # Download the NuGet package created in the previous job + - uses: actions/download-artifact@v3 + with: + name: nuget + path: ${{ env.NuGetDirectory }} + + # Install the .NET SDK indicated in the global.json file + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + + # Publish all NuGet packages to NuGet.org + # Use --skip-duplicate to prevent errors if a package with the same version already exists. + # If you retry a failed workflow, already published packages will be skipped without error. + - name: Publish NuGet package + run: | + foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + } From 087bfdc1a8a75a10847ece4318f274eaa76d4386 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:06:05 +0100 Subject: [PATCH 02/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index c159778..8f7da93 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -89,7 +89,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 - name: Run tests - run: dotnet test path/to/YourClassLibrary.Tests.csproj --configuration Release + run: dotnet test ${{ env.NuGetDirectory }} --configuration Release deploy: # Publish only when creating a GitHub Release From 4d2a25201dbd6caeb255b69d70ee66432668c302 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:10:37 +0100 Subject: [PATCH 03/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 8f7da93..733273f 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -34,11 +34,15 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 + - name: Set Project Name + run: echo "PROJECT_NAME=AzureDevopsWebhookService.Contracts" >> $GITHUB_ENV + - name: Find project path id: find-path + shell: bash run: | - # Search for a specific project file (e.g., *.csproj for a C# project) - PROJECT_PATH=$(find . -name "*AzureDevopsWebhookService.Contracts.csproj") + # Search for the specific project file by name + PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") echo "Project path found: $PROJECT_PATH" # Save the project path as an output variable From 6df736e93ba8ab13423f88e652db99656399638e Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:18:44 +0100 Subject: [PATCH 04/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 733273f..2649d8c 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -20,7 +20,7 @@ env: defaults: run: - shell: pwsh + shell: bash jobs: create_nuget: @@ -39,21 +39,21 @@ jobs: - name: Find project path id: find-path - shell: bash run: | # Search for the specific project file by name PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") echo "Project path found: $PROJECT_PATH" # Save the project path as an output variable - echo "::set-output name=project_path::$PROJECT_PATH" + echo "project_path=$PROJECT_PATH" >> $GITHUB_ENV - name: Set NuGet directory run: echo "NuGetDirectory=$HOME/.nuget/packages" >> $GITHUB_ENV # Create the NuGet package in the folder from the environment variable NuGetDirectory - name: Pack project - run: dotnet pack ${{ steps.find-path.outputs.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} + run: dotnet pack $PROJECT_PATH --configuration Release --output ${{ env.NuGetDirectory }} + # Publish the NuGet package as an artifact, so they can be used in the following jobs - uses: actions/upload-artifact@v3 with: @@ -80,11 +80,8 @@ jobs: run: dotnet tool update TunetCom.NuGetPackageValidation.Tool --global # Validate metadata and content of the NuGet package - # https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab - # If some rules are not applicable, you can disable them - # using the --excluded-rules or --excluded-rule-ids option - name: Validate package - run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg") + run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") run_test: runs-on: ubuntu-latest @@ -97,9 +94,7 @@ jobs: deploy: # Publish only when creating a GitHub Release - # https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository - # You can update this logic if you want to manage releases differently - if: github.event_name == 'push' + if: github.event_name == 'release' && github.event.action == 'published' runs-on: ubuntu-latest needs: [ validate_nuget, run_test ] steps: @@ -114,10 +109,8 @@ jobs: uses: actions/setup-dotnet@v4 # Publish all NuGet packages to NuGet.org - # Use --skip-duplicate to prevent errors if a package with the same version already exists. - # If you retry a failed workflow, already published packages will be skipped without error. - name: Publish NuGet package run: | - foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { - dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate - } + for file in ${{ env.NuGetDirectory }}/*.nupkg; do + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + done From cb4ae5f3f01ff8ce6924d6aef58d942d58b4f1b2 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:26:14 +0100 Subject: [PATCH 05/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 2649d8c..602a81a 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -44,7 +44,7 @@ jobs: PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") echo "Project path found: $PROJECT_PATH" - # Save the project path as an output variable + # Save the project path as an environment variable echo "project_path=$PROJECT_PATH" >> $GITHUB_ENV - name: Set NuGet directory @@ -52,7 +52,7 @@ jobs: # Create the NuGet package in the folder from the environment variable NuGetDirectory - name: Pack project - run: dotnet pack $PROJECT_PATH --configuration Release --output ${{ env.NuGetDirectory }} + run: dotnet pack ${{ env.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} # Publish the NuGet package as an artifact, so they can be used in the following jobs - uses: actions/upload-artifact@v3 From a8a017dde8950186680064921c9ab778f7f332cc Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:30:04 +0100 Subject: [PATCH 06/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 602a81a..27c6934 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -64,7 +64,6 @@ jobs: validate_nuget: runs-on: ubuntu-latest - needs: [ create_nuget ] steps: # Install the .NET SDK indicated in the global.json file - name: Setup .NET @@ -76,8 +75,9 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} + # Manually install the tool if it cannot be found - name: Install nuget validator - run: dotnet tool update TunetCom.NuGetPackageValidation.Tool --global + run: dotnet tool install TunetCom.NuGetPackageValidation.Tool --global --version # Validate metadata and content of the NuGet package - name: Validate package From 04a790d1d95ea76eb7c96f70ddc2f335a1f61087 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:54:54 +0100 Subject: [PATCH 07/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 27c6934..5073064 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -73,7 +73,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: nuget - path: ${{ env.NuGetDirectory }} + path: ${{ env.NuGetDirectory }}/*.nupgk # Manually install the tool if it cannot be found - name: Install nuget validator From 285ddef42fc39de5b86289bb6f0ec12e5595d55d Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:59:27 +0100 Subject: [PATCH 08/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 5073064..f346cad 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -73,7 +73,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: nuget - path: ${{ env.NuGetDirectory }}/*.nupgk + path: "/home/runner/.nuget/packages/AzureDevopsWebhookService.Contracts.1.0.0.nupkg" # Manually install the tool if it cannot be found - name: Install nuget validator From 523d8ebe832ab82059d2180b41d0bf689ca5ca7a Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:05:35 +0100 Subject: [PATCH 09/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index f346cad..27c6934 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -73,7 +73,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: nuget - path: "/home/runner/.nuget/packages/AzureDevopsWebhookService.Contracts.1.0.0.nupkg" + path: ${{ env.NuGetDirectory }} # Manually install the tool if it cannot be found - name: Install nuget validator From 123c7606770c61226f710f7656adff3fa563147c Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:12:16 +0100 Subject: [PATCH 10/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 111 +++++++++++++--------------- 1 file changed, 53 insertions(+), 58 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 27c6934..427d9d6 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -1,17 +1,18 @@ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: publish + on: - workflow_dispatch: # Allow running the workflow manually from the GitHub UI + workflow_dispatch: # Allow running the workflow manually from the GitHub UI push: branches: - - 'main' # Run the workflow when pushing to the main branch + - 'main' # Run the workflow when pushing to the main branch pull_request: branches: - - '*' # Run the workflow for all pull requests + - '*' # Run the workflow for all pull requests release: types: - - published # Run the workflow when a new GitHub release is published + - published # Run the workflow when a new GitHub release is published env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 @@ -26,90 +27,84 @@ jobs: create_nuget: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Get all history to allow automatic versioning using MinVer - - # Install the .NET SDK indicated in the global.json file - - name: Setup .NET - uses: actions/setup-dotnet@v4 - - - name: Set Project Name - run: echo "PROJECT_NAME=AzureDevopsWebhookService.Contracts" >> $GITHUB_ENV - - - name: Find project path - id: find-path - run: | - # Search for the specific project file by name - PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") - echo "Project path found: $PROJECT_PATH" - - # Save the project path as an environment variable - echo "project_path=$PROJECT_PATH" >> $GITHUB_ENV - - - name: Set NuGet directory - run: echo "NuGetDirectory=$HOME/.nuget/packages" >> $GITHUB_ENV - - # Create the NuGet package in the folder from the environment variable NuGetDirectory - - name: Pack project - run: dotnet pack ${{ env.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} - - # Publish the NuGet package as an artifact, so they can be used in the following jobs - - uses: actions/upload-artifact@v3 - with: - name: nuget - if-no-files-found: error - retention-days: 7 - path: ${{ env.NuGetDirectory }}/*.nupkg + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Get all history to allow automatic versioning using MinVer + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + + - name: Set Project Name + run: echo "PROJECT_NAME=AzureDevopsWebhookService.Contracts" >> $GITHUB_ENV + + - name: Find project path + id: find-path + run: | + PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") + echo "Project path found: $PROJECT_PATH" + echo "project_path=$PROJECT_PATH" >> $GITHUB_ENV + + - name: Set NuGet directory + run: echo "NuGetDirectory=$HOME/.nuget/packages" >> $GITHUB_ENV + + - name: Pack project + run: dotnet pack ${{ env.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} + + - name: Upload NuGet artifact + uses: actions/upload-artifact@v3 + with: + name: nuget + if-no-files-found: error + retention-days: 7 + path: ${{ env.NuGetDirectory }}/*.nupkg validate_nuget: runs-on: ubuntu-latest + needs: create_nuget steps: - # Install the .NET SDK indicated in the global.json file - - name: Setup .NET + - name: Setup .NET SDK uses: actions/setup-dotnet@v4 - # Download the NuGet package created in the previous job - - uses: actions/download-artifact@v3 + - name: Download NuGet artifact + uses: actions/download-artifact@v3 with: name: nuget path: ${{ env.NuGetDirectory }} - # Manually install the tool if it cannot be found - name: Install nuget validator run: dotnet tool install TunetCom.NuGetPackageValidation.Tool --global --version - # Validate metadata and content of the NuGet package - name: Validate package run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") run_test: runs-on: ubuntu-latest + needs: validate_nuget steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - - name: Run tests - run: dotnet test ${{ env.NuGetDirectory }} --configuration Release + - uses: actions/checkout@v3 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + + - name: Run tests + run: dotnet test ${{ env.NuGetDirectory }} --configuration Release deploy: - # Publish only when creating a GitHub Release if: github.event_name == 'release' && github.event.action == 'published' runs-on: ubuntu-latest - needs: [ validate_nuget, run_test ] + needs: run_test steps: - # Download the NuGet package created in the previous job - - uses: actions/download-artifact@v3 + - name: Download NuGet artifact + uses: actions/download-artifact@v3 with: name: nuget path: ${{ env.NuGetDirectory }} - # Install the .NET SDK indicated in the global.json file - - name: Setup .NET Core + - name: Setup .NET SDK uses: actions/setup-dotnet@v4 - # Publish all NuGet packages to NuGet.org - - name: Publish NuGet package + - name: Publish NuGet packages run: | for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate From 2b813865e91b2784a131f55d6d14962c9fe386f5 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:15:24 +0100 Subject: [PATCH 11/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 427d9d6..8d7d1cb 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -73,7 +73,7 @@ jobs: path: ${{ env.NuGetDirectory }} - name: Install nuget validator - run: dotnet tool install TunetCom.NuGetPackageValidation.Tool --global --version + run: dotnet tool install ${{ env.NuGetDirectory }} --global --version - name: Validate package run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") From f8409960dfc50cd7f20e4cbe20d6bbba74088bde Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:18:28 +0100 Subject: [PATCH 12/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 8d7d1cb..ee6db71 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -72,8 +72,8 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} - - name: Install nuget validator - run: dotnet tool install ${{ env.NuGetDirectory }} --global --version + #- name: Install nuget validator + # run: dotnet tool install AzureDevopsWebhookService.Contracts --global --version - name: Validate package run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") From a029202a903ba212ffcafaa76d5e4e4e423c55f1 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:21:22 +0100 Subject: [PATCH 13/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index ee6db71..a738669 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -72,8 +72,8 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} - #- name: Install nuget validator - # run: dotnet tool install AzureDevopsWebhookService.Contracts --global --version + - name: Install nuget validator + run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global - name: Validate package run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") From b660cd773ac0cf2228391f3ca7e3d4d787fa5d8a Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:55:07 +0100 Subject: [PATCH 14/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index a738669..6cdcbfa 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -72,11 +72,11 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} - - name: Install nuget validator - run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global + #- name: Install nuget validator + # run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global - - name: Validate package - run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") + #- name: Validate package + # run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") run_test: runs-on: ubuntu-latest From 087c3d4df658bb7f1b4a7889efbe775ed9819b99 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:05:19 +0100 Subject: [PATCH 15/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 6cdcbfa..d249088 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -72,12 +72,6 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} - #- name: Install nuget validator - # run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global - - #- name: Validate package - # run: meziantou.validate-nuget-package $(find ${{ env.NuGetDirectory }} -name "*.nupkg") - run_test: runs-on: ubuntu-latest needs: validate_nuget From e169373a767fd5f0f375f45f48c10ae5a85f0873 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:07:52 +0100 Subject: [PATCH 16/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index d249088..7920e59 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -72,22 +72,9 @@ jobs: name: nuget path: ${{ env.NuGetDirectory }} - run_test: - runs-on: ubuntu-latest - needs: validate_nuget - steps: - - uses: actions/checkout@v3 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - - - name: Run tests - run: dotnet test ${{ env.NuGetDirectory }} --configuration Release - deploy: if: github.event_name == 'release' && github.event.action == 'published' runs-on: ubuntu-latest - needs: run_test steps: - name: Download NuGet artifact uses: actions/download-artifact@v3 From c5ef366ece2619e4d3c181532f545aaa895ba7d0 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:10:27 +0100 Subject: [PATCH 17/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 7920e59..2b864dd 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -75,6 +75,7 @@ jobs: deploy: if: github.event_name == 'release' && github.event.action == 'published' runs-on: ubuntu-latest + needs: validate_nuget steps: - name: Download NuGet artifact uses: actions/download-artifact@v3 From 1c843519c66e99e2d11b641e6a217b6ac3e89196 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:38:31 +0100 Subject: [PATCH 18/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 2b864dd..b084b86 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -73,9 +73,8 @@ jobs: path: ${{ env.NuGetDirectory }} deploy: - if: github.event_name == 'release' && github.event.action == 'published' runs-on: ubuntu-latest - needs: validate_nuget + needs: create_nuget steps: - name: Download NuGet artifact uses: actions/download-artifact@v3 From 59371697ba50c94c948a0d2d35d3af12c1c7208d Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:38:06 +0100 Subject: [PATCH 19/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index b084b86..27dcbf6 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -74,7 +74,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: create_nuget + needs: validate_nuget steps: - name: Download NuGet artifact uses: actions/download-artifact@v3 From 7f89ec84d312976031d650971f188acd55277867 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:04:16 +0100 Subject: [PATCH 20/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 27dcbf6..93f13de 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -88,5 +88,5 @@ jobs: - name: Publish NuGet packages run: | for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ env.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 135f573feb7759a2ecdf7fe28a8bf14a71cac0aa Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:08:35 +0100 Subject: [PATCH 21/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 93f13de..b1481f1 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -88,5 +88,5 @@ jobs: - name: Publish NuGet packages run: | for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ env.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ secret.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From d441354a8683b04d1c276de37f855bc2b433d32e Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:10:59 +0100 Subject: [PATCH 22/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index b1481f1..27dcbf6 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -88,5 +88,5 @@ jobs: - name: Publish NuGet packages run: | for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secret.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 3e06dd7e87cea862d3217f59d267cc9768a3bda0 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:18:25 +0100 Subject: [PATCH 23/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 27dcbf6..a0005cb 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,6 +87,6 @@ jobs: - name: Publish NuGet packages run: | - for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate - done + foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + } From 4095d32981a3faff0863c6960850b28d22de0f12 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:20:53 +0100 Subject: [PATCH 24/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index a0005cb..16f35f3 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,6 +87,6 @@ jobs: - name: Publish NuGet packages run: | - foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { + foreach(file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate } From e8fc91a33d0e64b9c63736b1a07d0ab8d3df59ea Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:24:06 +0100 Subject: [PATCH 25/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 16f35f3..59474fb 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,6 +87,6 @@ jobs: - name: Publish NuGet packages run: | - foreach(file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { + foreach(file in (Get-ChildItem "${{ env.NuGetDirectory }}"/*.nupkg)) { dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate } From 6304f4915fb28b9e085f2b3c83da97997016bfa5 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:25:49 +0100 Subject: [PATCH 26/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 59474fb..27dcbf6 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,6 +87,6 @@ jobs: - name: Publish NuGet packages run: | - foreach(file in (Get-ChildItem "${{ env.NuGetDirectory }}"/*.nupkg)) { - dotnet nuget push $file --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate - } + for file in ${{ env.NuGetDirectory }}/*.nupkg; do + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + done From 7a3151712aaaedf6d117c0b53fc646b462da9f36 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Wed, 3 Jul 2024 19:24:32 +0100 Subject: [PATCH 27/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 27dcbf6..81ff7c9 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,6 +87,7 @@ jobs: - name: Publish NuGet packages run: | + echo "NuGet Secret Key: ${{ secrets.NUGET_SECRET_KEY }}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 6afee9fea39640e4bf6fb501c781f4c2f06b81be Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Wed, 3 Jul 2024 19:28:38 +0100 Subject: [PATCH 28/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 81ff7c9..af25c3c 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,7 +87,7 @@ jobs: - name: Publish NuGet packages run: | - echo "NuGet Secret Key: ${{ secrets.NUGET_SECRET_KEY }}" + echo "Length of NuGet Secret Key: ${#${{ secrets.NUGET_SECRET_KEY }}}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 89cf8ceb03ce4b77adfefdd5b0815b985cc215f8 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Wed, 3 Jul 2024 19:53:15 +0100 Subject: [PATCH 29/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index af25c3c..bc189e0 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -86,8 +86,11 @@ jobs: uses: actions/setup-dotnet@v4 - name: Publish NuGet packages + env: + SUPER_SECRET: ${{ secrets.SuperSecret }} run: | echo "Length of NuGet Secret Key: ${#${{ secrets.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key: ${#${{ env.SUPER_SECRET }}}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ env.SUPER_SECRET }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 7ffff4263943a5435aaeaecb3f19980bb3ca9732 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Wed, 3 Jul 2024 19:55:52 +0100 Subject: [PATCH 30/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index bc189e0..ce56f89 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -90,7 +90,6 @@ jobs: SUPER_SECRET: ${{ secrets.SuperSecret }} run: | echo "Length of NuGet Secret Key: ${#${{ secrets.NUGET_SECRET_KEY }}}" - echo "Length of NuGet Secret Key: ${#${{ env.SUPER_SECRET }}}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ env.SUPER_SECRET }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 5c09786548a178c783906a2066a6c2fb491be5b6 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:00:26 +0100 Subject: [PATCH 31/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index ce56f89..1f368cd 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,9 +87,10 @@ jobs: - name: Publish NuGet packages env: - SUPER_SECRET: ${{ secrets.SuperSecret }} + SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | - echo "Length of NuGet Secret Key: ${#${{ secrets.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key from env: ${#${{ env.NUGET_SECRET_KEY }}}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 36c9006327c465200855908ac407ddc081663db4 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:05:58 +0100 Subject: [PATCH 32/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 1f368cd..5015994 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -90,7 +90,8 @@ jobs: SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" - echo "Length of NuGet Secret Key from env: ${#${{ env.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key from env: ${#${{NUGET_SECRET_KEY}}}" + echo "Length of NuGet Secret Key from env: $NUGET_SECRET_KEY" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 1a3a714f897d2adab1d84e08bf03ee200b088b6e Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:07:16 +0100 Subject: [PATCH 33/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 5015994..d783d0c 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -90,8 +90,8 @@ jobs: SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" echo "Length of NuGet Secret Key from env: ${#${{NUGET_SECRET_KEY}}}" - echo "Length of NuGet Secret Key from env: $NUGET_SECRET_KEY" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 3e829db9165ce3d76d32a5fed414a5d7eaebcc91 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:09:27 +0100 Subject: [PATCH 34/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index d783d0c..91a8b14 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -18,6 +18,7 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true NuGetDirectory: ${{ github.workspace }}/nuget + NUGET_SECRET_KEY: oy2gybbgbikaypvqy7caqknsylauhdvenfd4ndfymy4l7e defaults: run: From 74765597d250027806d6db0972eb3ea6e0b3c5dc Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:11:14 +0100 Subject: [PATCH 35/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 91a8b14..18fae06 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -92,7 +92,6 @@ jobs: run: | echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" - echo "Length of NuGet Secret Key from env: ${#${{NUGET_SECRET_KEY}}}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 7e0b64e3561debbff283f14a8110560a52b9ad83 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:14:37 +0100 Subject: [PATCH 36/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 18fae06..dcd6a42 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -92,6 +92,7 @@ jobs: run: | echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" + echo "Length of NuGet Secret Key from env : $NUGET_SECRET_KEY!" for file in ${{ env.NuGetDirectory }}/*.nupkg; do dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 966ff772b7668675b824e6e8c17174442182b0c7 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:17:20 +0100 Subject: [PATCH 37/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index dcd6a42..6e03d00 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -94,5 +94,5 @@ jobs: echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" echo "Length of NuGet Secret Key from env : $NUGET_SECRET_KEY!" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "$NUGET_SECRET_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate done From 09bf03409f7aa373c68435fc8f93e279284894d5 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:19:20 +0100 Subject: [PATCH 38/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 6e03d00..be4cd51 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -90,9 +90,9 @@ jobs: env: SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | - echo "Length of NuGet Secret Key from secret: ${#${{ secrets.NUGET_SECRET_KEY }}}" + echo "Length of NuGet Secret Key from secret: ${{ secrets.NUGET_SECRET_KEY }}" echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" echo "Length of NuGet Secret Key from env : $NUGET_SECRET_KEY!" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "$NUGET_SECRET_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate done From e4c42c565cc1c6b0602c3d21b066a521e9babccf Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:26:29 +0100 Subject: [PATCH 39/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index be4cd51..3189c5c 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -18,7 +18,6 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true NuGetDirectory: ${{ github.workspace }}/nuget - NUGET_SECRET_KEY: oy2gybbgbikaypvqy7caqknsylauhdvenfd4ndfymy4l7e defaults: run: @@ -91,8 +90,9 @@ jobs: SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | echo "Length of NuGet Secret Key from secret: ${{ secrets.NUGET_SECRET_KEY }}" - echo "Length of NuGet Secret Key from env: ${#${{env.NUGET_SECRET_KEY}}}" - echo "Length of NuGet Secret Key from env : $NUGET_SECRET_KEY!" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate || { + echo "Failed to push $file" + exit 1 + } done From 8cf335b800429143280ae8c6324d70a72c80dca4 Mon Sep 17 00:00:00 2001 From: Marwen Saad <81447893+MarwenSaad@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:34:13 +0100 Subject: [PATCH 40/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 3189c5c..f8c523f 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -89,10 +89,10 @@ jobs: env: SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} run: | - echo "Length of NuGet Secret Key from secret: ${{ secrets.NUGET_SECRET_KEY }}" + echo "Length of NuGet Secret Key from secret: ${#SUPER_SECRET}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "${{ secrets.NUGET_SECRET_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate || { - echo "Failed to push $file" - exit 1 - } + dotnet nuget push "$file" --api-key "$SUPER_SECRET" --source https://api.nuget.org/v3/index.json --skip-duplicate || { + echo "Failed to push $file" + exit 1 + } done From 6b81858d3fd44035569998102b28ea6819dad54b Mon Sep 17 00:00:00 2001 From: Nieze Ben Mansour <155241795+Nieze-BenMansour@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:14:56 +0100 Subject: [PATCH 41/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index f8c523f..8133bec 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -87,7 +87,7 @@ jobs: - name: Publish NuGet packages env: - SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY }} + SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY_TUNNETCOM }} run: | echo "Length of NuGet Secret Key from secret: ${#SUPER_SECRET}" for file in ${{ env.NuGetDirectory }}/*.nupkg; do From 3e2a140ff53442bd062f65d689bb73ff9888afa5 Mon Sep 17 00:00:00 2001 From: Nieze Ben Mansour <155241795+Nieze-BenMansour@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:23:52 +0100 Subject: [PATCH 42/43] Update PublishNugate.yml --- .github/workflows/PublishNugate.yml | 101 +++++----------------------- 1 file changed, 16 insertions(+), 85 deletions(-) diff --git a/.github/workflows/PublishNugate.yml b/.github/workflows/PublishNugate.yml index 8133bec..146adbb 100644 --- a/.github/workflows/PublishNugate.yml +++ b/.github/workflows/PublishNugate.yml @@ -1,98 +1,29 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json - -name: publish +name: Publish NuGet Package on: - workflow_dispatch: # Allow running the workflow manually from the GitHub UI push: branches: - - 'main' # Run the workflow when pushing to the main branch - pull_request: - branches: - - '*' # Run the workflow for all pull requests - release: - types: - - published # Run the workflow when a new GitHub release is published - -env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_NOLOGO: true - NuGetDirectory: ${{ github.workspace }}/nuget - -defaults: - run: - shell: bash + - main jobs: - create_nuget: + build: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Get all history to allow automatic versioning using MinVer - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - - - name: Set Project Name - run: echo "PROJECT_NAME=AzureDevopsWebhookService.Contracts" >> $GITHUB_ENV - - name: Find project path - id: find-path - run: | - PROJECT_PATH=$(find . -name "${{ env.PROJECT_NAME }}.csproj") - echo "Project path found: $PROJECT_PATH" - echo "project_path=$PROJECT_PATH" >> $GITHUB_ENV - - - name: Set NuGet directory - run: echo "NuGetDirectory=$HOME/.nuget/packages" >> $GITHUB_ENV - - - name: Pack project - run: dotnet pack ${{ env.project_path }} --configuration Release --output ${{ env.NuGetDirectory }} - - - name: Upload NuGet artifact - uses: actions/upload-artifact@v3 - with: - name: nuget - if-no-files-found: error - retention-days: 7 - path: ${{ env.NuGetDirectory }}/*.nupkg - - validate_nuget: - runs-on: ubuntu-latest - needs: create_nuget steps: - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + - name: Checkout code + uses: actions/checkout@v3 - - name: Download NuGet artifact - uses: actions/download-artifact@v3 - with: - name: nuget - path: ${{ env.NuGetDirectory }} + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' - deploy: - runs-on: ubuntu-latest - needs: validate_nuget - steps: - - name: Download NuGet artifact - uses: actions/download-artifact@v3 - with: - name: nuget - path: ${{ env.NuGetDirectory }} + - name: Find .Contracts Project + id: find_contracts_project + run: echo "::set-output name=project_path::$(find . -name '*.Contracts.csproj')" - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + - name: Pack .Contracts Project + run: dotnet pack ${{ steps.find_contracts_project.outputs.project_path }} --configuration Release --output ./artifacts - - name: Publish NuGet packages - env: - SUPER_SECRET: ${{ secrets.NUGET_SECRET_KEY_TUNNETCOM }} - run: | - echo "Length of NuGet Secret Key from secret: ${#SUPER_SECRET}" - for file in ${{ env.NuGetDirectory }}/*.nupkg; do - dotnet nuget push "$file" --api-key "$SUPER_SECRET" --source https://api.nuget.org/v3/index.json --skip-duplicate || { - echo "Failed to push $file" - exit 1 - } - done + - name: Publish .Contracts Package + run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json From e8bce56fcee47ae3aa55d879e3e06a4dbd50ac0c Mon Sep 17 00:00:00 2001 From: Nieze Ben Mansour <155241795+Nieze-BenMansour@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:25:59 +0100 Subject: [PATCH 43/43] Update PublishNugate.yml