Skip to content

Commit 872f5b7

Browse files
Update release.yml
1 parent f72b1b9 commit 872f5b7

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: Build and Package Release
33
on:
44
push:
55
tags:
6-
- 'v*' # Triggers on v1.0, v2.1.5, etc.
6+
- 'v*'
77

88
jobs:
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,40 @@ jobs:
2019
with:
2120
dotnet-version: '8.0.x'
2221

22+
- name: Restore dependencies
23+
run: dotnet restore
24+
25+
# --- THE GATEKEEPER: RUN TESTS ---
26+
- name: Run Tests
27+
# If this fails, the workflow stops here and no release is created
28+
run: |
29+
dotnet test OutSystems.NetChecksumUtils.UnitTests/OutSystems.NetChecksumUtils.UnitTests.csproj \
30+
--configuration Release \
31+
--no-restore \
32+
--nologo \
33+
--collect:"XPlat Code Coverage" \
34+
--results-directory ./coverage
35+
36+
- name: Report Code Coverage (Optional Summary)
37+
uses: irongut/CodeCoverageSummary@v1.3.0
38+
with:
39+
filename: coverage/**/coverage.cobertura.xml
40+
badge: true
41+
format: markdown
42+
output: both
43+
44+
- name: Write Summary
45+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
46+
47+
# --- PACKAGING STEPS (Only runs if tests pass) ---
2348
- name: Get Version from Tag
2449
id: get_version
2550
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2651

2752
- name: Publish App
28-
# We publish to a local 'publish' folder
29-
run: dotnet publish OutSystems.NetChecksumUtils/OutSystems.NetChecksumUtils.csproj -c Release -r linux-x64 --self-contained false -o ./publish
53+
run: dotnet publish OutSystems.NetChecksumUtils/OutSystems.NetChecksumUtils.csproj -c Release -r linux-x64 --self-contained false -o ./publish --no-restore
3054

3155
- name: Create Versioned Zip
32-
# This creates NetChecksumUtils_v1.0.0.zip (or whatever your tag is)
3356
run: |
3457
cd ./publish
3558
zip -r ../NetChecksumUtils_${{ steps.get_version.outputs.VERSION }}.zip .

0 commit comments

Comments
 (0)