Skip to content

Commit 740ee75

Browse files
authored
Merge pull request #30 from afonsoft/feature/update-actions
Feature/update actions
2 parents e3d6db1 + dbc6825 commit 740ee75

2 files changed

Lines changed: 13 additions & 30 deletions

File tree

.github/workflows/publish-all.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ jobs:
5353
- name: 🧪 Run Tests
5454
run: |
5555
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
6157
6258
- name: � Check CI/CD Status
6359
run: |
@@ -101,43 +97,27 @@ jobs:
10197

10298
- name: 📦 Pack NuGet
10399
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 }}"
106102
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 {
114105
# Extract version from tag
115-
VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
106+
$VERSION="${{ github.ref_name }}" -replace "^v", ""
116107
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+
}
124110
125111
- name: 📦 Publish to GitHub Packages
126112
run: |
127113
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
132115
133116
- name: 📦 Publish to NuGet.org
134117
if: ${{ github.event.inputs.publish_nuget != 'false' }}
135118
run: |
136119
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
141121
142122
- name: ✅ NuGet Summary
143123
run: |

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "QRCoder.Core.sln"
3+
}

0 commit comments

Comments
 (0)