-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (89 loc) · 2.91 KB
/
dotnet-desktop.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: build DicomGrep
on:
push:
branches-ignore:
- 'archive'
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
branches-ignore:
- 'archive'
paths-ignore:
- 'README.md'
- 'LICENSE'
workflow_dispatch:
inputs:
PublishSingleFile_Windows:
description: 'Publish single file for Windows'
required: false
type: boolean
env:
dotnet_version: '8.0.x'
jobs:
build_and_test_debug:
name: 'Build and Test (debug)'
runs-on: windows-latest
env:
configuration: 'Debug'
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet_version }}
# cache: true
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build DicomGrep/DicomGrep.csproj --no-restore --configuration $env:configuration --output bin/net$env:dotnet_version/$env:configuration
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Upload articraft
uses: actions/upload-artifact@v4
with:
name: DicomGrep-${{ env.configuration }}-bare
path: |
bin/net${{ env.dotnet_version }}/${{ env.configuration }}
!bin/**/DICOM Dictionary.xml
!bin/**/Private Dictionary.xml
!bin/**/*.pdb
publish_windows_release:
name: 'publish Windows (release)'
runs-on: windows-latest
needs: build_and_test_debug
env:
configuration: 'Release'
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet_version }}
# cache: true
- name: Install dependencies
run: dotnet restore
- name: Publish
run: dotnet publish DicomGrep/DicomGrep.csproj -c $env:configuration --output bin/publish/net$env:dotnet_version/$env:configuration
- name: Upload articraft
uses: actions/upload-artifact@v4
with:
name: DicomGrep-${{ env.configuration }}-publish
path: |
bin/publish/net${{ env.dotnet_version }}/${{ env.configuration }}
!bin/**/DICOM Dictionary.xml
!bin/**/Private Dictionary.xml
!bin/**/*.pdb
- name: Publish With NET
if: ${{ inputs.PublishSingleFile_Windows }}
run: dotnet publish DicomGrep/DicomGrep.csproj -c $env:configuration -p:PublishSingleFile=true --output bin/publish2/net$env:dotnet_version/$env:configuration
- name: Upload articraft
if: ${{ inputs.PublishSingleFile_Windows }}
uses: actions/upload-artifact@v4
with:
name: DicomGrep-${{ env.configuration }}-publishWithNet${{ env.dotnet_version }}-Windows
path: |
bin/publish2/net${{ env.dotnet_version }}/${{ env.configuration }}
!bin/**/DICOM Dictionary.xml
!bin/**/Private Dictionary.xml
!bin/**/*.pdb