From e365c671222d75062c8e7b759846b8af6d6582fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 2 Jun 2025 17:30:03 +0200 Subject: [PATCH] update build --- .github/workflows/build.yml | 53 +++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdfbbf9..1e1c912 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,26 +7,24 @@ on: branches: - main workflow_dispatch: + jobs: build-frontend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@master + - name: Use Node.js 20 + uses: actions/setup-node@v4 with: node-version: 20 - name: Install Angular CLI - run: yarn global add @angular/cli + run: npm install -g @angular/cli - - name: Configure ng to use yarn - run: ng config --global cli.packageManager yarn - - - name: Yarn install + - name: Install dependencies working-directory: Frontend - run: yarn install + run: npm ci - name: Build Angular working-directory: Frontend @@ -43,29 +41,38 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup dotnet 9 + - name: Setup .NET 8 uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.0.x + dotnet-version: 8.0.x - - name: Install dependencies - working-directory: WebAPI - run: dotnet restore + - name: Restore dependencies + working-directory: src/Backend + run: dotnet restore DiunaBI.sln - - name: Build - working-directory: WebAPI + - name: Build solution + working-directory: src/Backend + run: dotnet build DiunaBI.sln --configuration Release --no-restore + + - name: Publish WebAPI + working-directory: src/Backend run: | - dotnet build --configuration Release --no-restore - dotnet publish --configuration Release --framework net9.0 --runtime linux-x64 --self-contained false --output ./WebApiBuild + dotnet publish DiunaBI.WebAPI/DiunaBI.WebAPI.csproj \ + --configuration Release \ + --framework net8.0 \ + --runtime linux-x64 \ + --self-contained false \ + --output ../../build/webapi - - name: Clean up - working-directory: WebAPI - run: | - rm ./WebApiBuild/appsettings.Development.json - rm ./WebApiBuild/client_secrets.Development.json + - name: Clean up sensitive files + working-directory: build/webapi + run: | + rm -f appsettings.Development.json + rm -f client_secrets.Development.json + rm -f diunabi-admin-firebase-Development.json - name: Upload artifact uses: actions/upload-artifact@v4 with: name: webapi - path: WebAPI/WebApiBuild \ No newline at end of file + path: build/webapi \ No newline at end of file