Zmodyfikowano plik ci.yml dla macierzy i artefaktów
This commit is contained in:
parent
e3ca61ebe5
commit
0114419526
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user