From b8d958b3d775375908a357a09df22c7353b716a8 Mon Sep 17 00:00:00 2001 From: Liliia Hurko <130755897+lilyhurko@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:50:19 +0100 Subject: [PATCH] Zmiana na .NET i wieloetapowe CI --- .gitea/workflows/ci.yml | 34 +++++++++++++++++++++++++++------- Program.cs | 10 ++++++++++ lab7.csproj | 10 ++++++++++ main.c | 7 ------- 4 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 Program.cs create mode 100644 lab7.csproj delete mode 100644 main.c diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4395332..c666c56 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,11 +8,31 @@ jobs: steps: - uses: actions/checkout@v4 - - name: build using gcc - run: gcc -Wall -Werror main.c -o program - - - name: Archive production artifacts - uses: actions/upload-artifact@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: - name: program - path: program \ No newline at end of file + dotnet-version: '8.0.x' + + - run: dotnet restore + - run: dotnet build + + - run: dotnet publish -o app -r linux-x64 --sc -p:PublishSingleFile=true -p:AssemblyName=app + + - run: tar cf app.tar app/ + + - uses: actions/upload-artifact@v3 + with: + name: app.tar + path: app.tar + + test: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: app.tar + + - run: tar xf app.tar/app.tar || tar xf app.tar + + - run: ./app/app \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..9a8d000 --- /dev/null +++ b/Program.cs @@ -0,0 +1,10 @@ +// Program.cs +using System; + +class Program +{ + static void Main() + { + Console.WriteLine("Hello, World!"); + } +} diff --git a/lab7.csproj b/lab7.csproj new file mode 100644 index 0000000..c28018d --- /dev/null +++ b/lab7.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + \ No newline at end of file diff --git a/main.c b/main.c deleted file mode 100644 index 99482fb..0000000 --- a/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - printf("Halo, Welt!"); - return 0; -} \ No newline at end of file