-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 1.98 KB
/
Copy pathci.yml
File metadata and controls
73 lines (57 loc) · 1.98 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and publish
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Restore
run: dotnet restore .\Adomd.Cli.slnx
- name: Verify formatting
run: dotnet format .\Adomd.Cli.slnx --verify-no-changes --no-restore
- name: Build
run: dotnet build .\Adomd.Cli.slnx --configuration Release --no-restore
- name: Test
shell: pwsh
run: |
$testProjects = Get-ChildItem -Path . -Recurse -Filter *.csproj |
Where-Object { $_.FullName -match '(?i)(test|tests)' }
if (-not $testProjects) {
Write-Host 'No test projects found.'
exit 0
}
foreach ($project in $testProjects) {
dotnet test $project.FullName --configuration Release --logger trx --results-directory .\TestResults
}
- name: Publish win-x64 executable
run: dotnet publish .\src\Adomd.Cli\Adomd.Cli.csproj --configuration Release --runtime win-x64 --self-contained true --output .\artifacts\publish\win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false
- name: Archive win-x64 executable
shell: pwsh
run: Compress-Archive -Path .\artifacts\publish\win-x64\* -DestinationPath .\artifacts\adomd-cli-win-x64.zip -Force
- name: Upload executable artifact
uses: actions/upload-artifact@v7
with:
name: adomd-cli-win-x64
path: artifacts\adomd-cli-win-x64.zip
if-no-files-found: error