From 3ce50911c15fc3628673f53be36b5582466ee20d Mon Sep 17 00:00:00 2001 From: Afonso Dutra Nogueira Filho Date: Wed, 18 Feb 2026 18:30:49 -0300 Subject: [PATCH 1/2] fix: Resolve PowerShell syntax errors in CI/CD workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## CI/CD Fixes - **PowerShell Syntax**: Fixed command line formatting for Windows runners - **Line Continuation**: Removed problematic backslash line continuations - **Script Logic**: Converted bash-style conditionals to PowerShell syntax - **Command Formatting**: Consolidated multi-line commands into single lines ## Technical Details - Fixed "Missing expression after unary operator '--'" error - Updated dotnet test command for Windows PowerShell compatibility - Corrected dotnet pack/push commands with proper PowerShell syntax - Maintained cross-platform compatibility for Linux/Ubuntu jobs ## Impact - โœ… CI/CD pipeline now works correctly on Windows runners - โœ… Test execution before publish validation fixed - โœ… NuGet packaging and publishing commands corrected - โœ… Maintained functionality for all workflow triggers --- .github/workflows/publish-all.yml | 40 ++++++++----------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish-all.yml b/.github/workflows/publish-all.yml index 1bf42ed..8b94072 100644 --- a/.github/workflows/publish-all.yml +++ b/.github/workflows/publish-all.yml @@ -53,11 +53,7 @@ jobs: - name: ๐Ÿงช Run Tests run: | echo "๐Ÿงช Running tests before publish..." - dotnet test QRCoder.Core.Tests/ \ - --configuration ${{ env.BUILD_CONFIG }} \ - --logger "trx;LogFileName=test-results.trx" \ - --results-directory TestResults \ - --verbosity normal + dotnet test QRCoder.Core.Tests/ --configuration ${{ env.BUILD_CONFIG }} --logger "trx;LogFileName=test-results.trx" --results-directory TestResults --verbosity normal - name: ๏ฟฝ Check CI/CD Status run: | @@ -101,43 +97,27 @@ jobs: - name: ๐Ÿ“ฆ Pack NuGet run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - VERSION="${{ github.event.inputs.version }}" + if ("${{ github.event_name }}" -eq "workflow_dispatch") { + $VERSION="${{ github.event.inputs.version }}" echo "Building version $VERSION from workflow_dispatch" - dotnet pack QRCoder.Core/QRCoder.Core.csproj \ - --configuration ${{ env.BUILD_CONFIG }} \ - --no-build \ - --output ./packages \ - -p:Version=$VERSION \ - -p:PackageReleaseNotes="Release version $VERSION" - else + dotnet pack QRCoder.Core/QRCoder.Core.csproj --configuration ${{ env.BUILD_CONFIG }} --no-build --output ./packages -p:Version=$VERSION -p:PackageReleaseNotes="Release version $VERSION" + } else { # Extract version from tag - VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') + $VERSION="${{ github.ref_name }}" -replace "^v", "" echo "Building version $VERSION from tag" - dotnet pack QRCoder.Core/QRCoder.Core.csproj \ - --configuration ${{ env.BUILD_CONFIG }} \ - --no-build \ - --output ./packages \ - -p:Version=$VERSION \ - -p:PackageReleaseNotes="Release version $VERSION" - fi + dotnet pack QRCoder.Core/QRCoder.Core.csproj --configuration ${{ env.BUILD_CONFIG }} --no-build --output ./packages -p:Version=$VERSION -p:PackageReleaseNotes="Release version $VERSION" + } - name: ๐Ÿ“ฆ Publish to GitHub Packages run: | echo "๐Ÿ“ฆ Publishing to GitHub Packages..." - dotnet nuget push ./packages/*.nupkg \ - --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' \ - --api-key ${{ secrets.GITHUB_TOKEN }} \ - --skip-duplicate + dotnet nuget push ./packages/*.nupkg --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate - name: ๐Ÿ“ฆ Publish to NuGet.org if: ${{ github.event.inputs.publish_nuget != 'false' }} run: | echo "๐Ÿ“ฆ Publishing to NuGet.org..." - dotnet nuget push ./packages/*.nupkg \ - --source 'https://api.nuget.org/v3/index.json' \ - --api-key ${{ secrets.NUGET_API_KEY }} \ - --skip-duplicate + dotnet nuget push ./packages/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate - name: โœ… NuGet Summary run: | From dbc68256448f92c00381e77c4a72d90011e77033 Mon Sep 17 00:00:00 2001 From: Afonso Dutra Nogueira Filho Date: Wed, 18 Feb 2026 18:31:29 -0300 Subject: [PATCH 2/2] feat settings --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7ffe03b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "QRCoder.Core.sln" +} \ No newline at end of file