-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.81 KB
/
dotnet-v8-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
name: .NET Core Desktop Build v8.0
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest # Utilizando runner Windows mais recente
env:
Solution_Name: EBS-LAB.sln # Nome da solução .NET Core
Test_Project_Path: EBS-LAB\EBS-LAB.csproj # Caminho para o projeto de testes, se houver
Project_Directory: EBS-LAB # Diretório do projeto para correção de caminho
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Instalar o .NET SDK
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x # Versão do .NET Core que está sendo utilizada no projeto
# Instalar MSBuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
# Executar testes (se existirem)
- name: Execute unit tests
run: |
dotnet restore $env:Solution_Name
dotnet test $env:Solution_Name
# Restaurar a aplicação .NET Core
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Build da solução .NET Core
- name: Build the application
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Carregar artefatos de build (sem assinatura ou empacotamento)
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Build Artifacts-${{ matrix.configuration }}§§
path: ${{ env.Project_Directory }}\bin\${{ matrix.configuration }}