From c67d4b9ef2739174f0ff26f1d20920074b29113f Mon Sep 17 00:00:00 2001 From: Dana123098 Date: Thu, 20 Nov 2025 12:40:36 +0100 Subject: [PATCH] Use matrix to build app for win-x64 and linux-x64 with artifacts --- .gitea/workflows/ci.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6b4a72b..da812fa 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -4,26 +4,29 @@ on: [push] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + rid: ["win-x64", "linux-x64"] + steps: - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' + - 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/ - - uses: actions/upload-artifact@v3 - with: - name: app.tar - path: app.tar - test: - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 + - name: publish app for ${{ matrix.rid }} + run: dotnet publish -o app-${{ matrix.rid }} -r ${{ matrix.rid }} --sc /p:PublishSingleFile=true,AssemblyName=app + + - name: pack app-${{ matrix.rid }} to tar + run: tar cf app-${{ matrix.rid }}.tar app-${{ matrix.rid }}/ + + - name: upload artifact for ${{ matrix.rid }} + uses: actions/upload-artifact@v3 with: - name: app.tar - - run: tar xf app.tar - - run: ./app/app + name: app-${{ matrix.rid }}.tar + path: app-${{ matrix.rid }}.tar