Zmodyfikowano plik ci.yml dla macierzy i artefaktów
All checks were successful
First CI / build (linux-x64) (push) Successful in 1m37s
First CI / build (win-x64) (push) Successful in 1m37s

This commit is contained in:
Aleksandra Olejarz 2024-11-26 14:15:20 +01:00
parent e3ca61ebe5
commit 0114419526

View File

@ -3,26 +3,29 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rid: ["win-x64", "linux-x64"] # Macierz dla dwóch platform
steps:
# Pobierz kod źródłowy z repozytorium
- uses: actions/checkout@v4
# Skonfiguruj .NET SDK w wersji 8.0.x
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
# Przywróć zależności
- run: dotnet restore
- run: dotnet build
- run: dotnet test
- run: dotnet publish -o app -r linux-x64 --sc /p:PublishSingleFile=true,AssemblyName=app
- run: tar cf app.tar app/
# Kompiluj i publikuj aplikację dla odpowiedniej platformy
- run: dotnet publish -o app-${{ matrix.rid }} -r ${{ matrix.rid }} --sc /p:PublishSingleFile=true
# Archiwizuj wyniki kompilacji do pliku .tar
- run: tar -cvf app-${{ matrix.rid }}.tar app-${{ matrix.rid }}
# Wyślij artefakty do systemu CI
- uses: actions/upload-artifact@v3
with:
name: app.tar
path: app.tar
test:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: app.tar
- run: tar xf app.tar
- run: ./app/app
name: app-${{ matrix.rid }}
path: app-${{ matrix.rid }}.tar