|
53 | 53 | - name: 🧪 Run Tests |
54 | 54 | run: | |
55 | 55 | echo "🧪 Running tests before publish..." |
56 | | - dotnet test QRCoder.Core.Tests/ \ |
57 | | - --configuration ${{ env.BUILD_CONFIG }} \ |
58 | | - --logger "trx;LogFileName=test-results.trx" \ |
59 | | - --results-directory TestResults \ |
60 | | - --verbosity normal |
| 56 | + dotnet test QRCoder.Core.Tests/ --configuration ${{ env.BUILD_CONFIG }} --logger "trx;LogFileName=test-results.trx" --results-directory TestResults --verbosity normal |
61 | 57 |
|
62 | 58 | - name: � Check CI/CD Status |
63 | 59 | run: | |
@@ -101,43 +97,27 @@ jobs: |
101 | 97 |
|
102 | 98 | - name: 📦 Pack NuGet |
103 | 99 | run: | |
104 | | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
105 | | - VERSION="${{ github.event.inputs.version }}" |
| 100 | + if ("${{ github.event_name }}" -eq "workflow_dispatch") { |
| 101 | + $VERSION="${{ github.event.inputs.version }}" |
106 | 102 | echo "Building version $VERSION from workflow_dispatch" |
107 | | - dotnet pack QRCoder.Core/QRCoder.Core.csproj \ |
108 | | - --configuration ${{ env.BUILD_CONFIG }} \ |
109 | | - --no-build \ |
110 | | - --output ./packages \ |
111 | | - -p:Version=$VERSION \ |
112 | | - -p:PackageReleaseNotes="Release version $VERSION" |
113 | | - else |
| 103 | + dotnet pack QRCoder.Core/QRCoder.Core.csproj --configuration ${{ env.BUILD_CONFIG }} --no-build --output ./packages -p:Version=$VERSION -p:PackageReleaseNotes="Release version $VERSION" |
| 104 | + } else { |
114 | 105 | # Extract version from tag |
115 | | - VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') |
| 106 | + $VERSION="${{ github.ref_name }}" -replace "^v", "" |
116 | 107 | echo "Building version $VERSION from tag" |
117 | | - dotnet pack QRCoder.Core/QRCoder.Core.csproj \ |
118 | | - --configuration ${{ env.BUILD_CONFIG }} \ |
119 | | - --no-build \ |
120 | | - --output ./packages \ |
121 | | - -p:Version=$VERSION \ |
122 | | - -p:PackageReleaseNotes="Release version $VERSION" |
123 | | - fi |
| 108 | + dotnet pack QRCoder.Core/QRCoder.Core.csproj --configuration ${{ env.BUILD_CONFIG }} --no-build --output ./packages -p:Version=$VERSION -p:PackageReleaseNotes="Release version $VERSION" |
| 109 | + } |
124 | 110 |
|
125 | 111 | - name: 📦 Publish to GitHub Packages |
126 | 112 | run: | |
127 | 113 | echo "📦 Publishing to GitHub Packages..." |
128 | | - dotnet nuget push ./packages/*.nupkg \ |
129 | | - --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' \ |
130 | | - --api-key ${{ secrets.GITHUB_TOKEN }} \ |
131 | | - --skip-duplicate |
| 114 | + dotnet nuget push ./packages/*.nupkg --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
132 | 115 |
|
133 | 116 | - name: 📦 Publish to NuGet.org |
134 | 117 | if: ${{ github.event.inputs.publish_nuget != 'false' }} |
135 | 118 | run: | |
136 | 119 | echo "📦 Publishing to NuGet.org..." |
137 | | - dotnet nuget push ./packages/*.nupkg \ |
138 | | - --source 'https://api.nuget.org/v3/index.json' \ |
139 | | - --api-key ${{ secrets.NUGET_API_KEY }} \ |
140 | | - --skip-duplicate |
| 120 | + dotnet nuget push ./packages/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
141 | 121 |
|
142 | 122 | - name: ✅ NuGet Summary |
143 | 123 | run: | |
|
0 commit comments