-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.14 KB
/
release.yml
File metadata and controls
77 lines (65 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and Package Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
# 1. Restore the solution (or both projects) for the target runtime
- name: Restore dependencies
run: dotnet restore OutSystems.NetChecksumUtils/OutSystems.NetChecksumUtils.sln -r linux-x64
# --- THE GATEKEEPER: RUN TESTS ---
- name: Run Tests
# If this fails, the workflow stops here and no release is created
run: |
dotnet test OutSystems.NetChecksumUtils.UnitTests/OutSystems.NetChecksumUtils.UnitTests.csproj \
--configuration Release \
--no-restore \
--nologo \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage
- name: Report Code Coverage (Optional Summary)
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
format: markdown
output: both
- name: Write Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
# --- PACKAGING STEPS (Only runs if tests pass) ---
- name: Get Version from Tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Publish App
run: |
dotnet publish OutSystems.NetChecksumUtils/OutSystems.NetChecksumUtils.csproj \
-c Release \
-r linux-x64 \
--self-contained false \
--no-restore \
-o ./publish
- name: Create Versioned Zip
run: |
cd ./publish
zip -r ../NetChecksumUtils_${{ steps.get_version.outputs.VERSION }}.zip .
cd ..
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: NetChecksumUtils_${{ steps.get_version.outputs.VERSION }}.zip
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}