@@ -3,14 +3,13 @@ name: Build and Package Release
33on :
44 push :
55 tags :
6- - ' v*' # Triggers on v1.0, v2.1.5, etc.
6+ - ' v*'
77
88jobs :
99 release :
1010 runs-on : ubuntu-latest
1111 permissions :
12- contents : write # Needed to create the release and upload assets
13-
12+ contents : write
1413 steps :
1514 - name : Checkout Code
1615 uses : actions/checkout@v4
@@ -20,16 +19,48 @@ jobs:
2019 with :
2120 dotnet-version : ' 8.0.x'
2221
22+ # 1. Restore the solution (or both projects) for the target runtime
23+ - name : Restore dependencies
24+ run : dotnet restore OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.sln -r linux-x64
25+
26+ # --- THE GATEKEEPER: RUN TESTS ---
27+
28+ - name : Run Tests
29+ # If this fails, the workflow stops here and no release is created
30+ run : |
31+ dotnet test OutSystems.YAEmailValidator.UnitTests/OutSystems.YAEmailValidator.UnitTests.csproj \
32+ --configuration Release \
33+ --no-restore \
34+ --nologo \
35+ --collect:"XPlat Code Coverage" \
36+ --results-directory ./coverage
37+
38+ - name : Report Code Coverage (Optional Summary)
39+ uses : irongut/CodeCoverageSummary@v1.3.0
40+ with :
41+ filename : coverage/**/coverage.cobertura.xml
42+ badge : true
43+ format : markdown
44+ output : both
45+
46+ - name : Write Summary
47+ run : cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
48+
49+ # --- PACKAGING STEPS (Only runs if tests pass) ---
2350 - name : Get Version from Tag
2451 id : get_version
2552 run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2653
2754 - name : Publish App
28- # We publish to a local 'publish' folder
29- run : dotnet publish OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.csproj -c Release -r linux-x64 --self-contained false -o ./publish
30-
55+ run : |
56+ dotnet publish OutSystems.YAEmailValidator/OutSystems.YAEmailValidator.csproj \
57+ -c Release \
58+ -r linux-x64 \
59+ --self-contained false \
60+ --no-restore \
61+ -o ./publish
62+
3163 - name : Create Versioned Zip
32- # This creates YAEmailValidator_v1.0.0.zip (or whatever your tag is)
3364 run : |
3465 cd ./publish
3566 zip -r ../YAEmailValidator_${{ steps.get_version.outputs.VERSION }}.zip .
3869 - name : Create GitHub Release
3970 uses : softprops/action-gh-release@v2
4071 with :
41- files : YAEmailValidator_ ${{ steps.get_version.outputs.VERSION }}.zip
72+ files : NetChecksumUtils_ ${{ steps.get_version.outputs.VERSION }}.zip
4273 name : Release ${{ steps.get_version.outputs.VERSION }}
4374 draft : false
4475 prerelease : false
0 commit comments