From 3b07558bf6a1230a0bcd25f06a6226063ee20a4e Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 11 May 2026 16:27:11 +0000 Subject: [PATCH] ci: push build logs to Gitea generic package registry Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build.yml | 46 +++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fc6342c..22028ae 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -113,18 +113,42 @@ jobs: } if ($code -ne 0) { exit $code } - - name: Upload build logs + - name: Push build logs to Gitea generic package registry if: always() - uses: actions/upload-artifact@v4 - with: - name: build-logs-run${{ github.run_id }} - path: | - build.console.log - build.log - build-errors.log - src/OutlookAddin/OutlookAddin.csproj - retention-days: 7 - if-no-files-found: warn + shell: powershell + env: + REG_USER: ${{ secrets.REGISTRY_USER }} + REG_PASS: ${{ secrets.REGISTRY_PASSWORD }} + RUN_ID: ${{ github.run_id }} + run: | + $logs = @( + @{ name = 'build.console.log'; path = 'build.console.log' }, + @{ name = 'build.log'; path = 'build.log' }, + @{ name = 'build-errors.log'; path = 'build-errors.log' }, + @{ name = 'OutlookAddin.csproj'; path = 'src/OutlookAddin/OutlookAddin.csproj' } + ) + $base = "https://gitea.dev.marcus-law.co.il/api/packages/espocrm-extensions/generic/outlook-addin-build-log/run-$env:RUN_ID" + $pair = "$($env:REG_USER):$($env:REG_PASS)" + $auth = "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair)) + foreach ($entry in $logs) { + if (Test-Path $entry.path) { + Write-Host "Uploading $($entry.name)..." + try { + $resp = Invoke-WebRequest -Method Put ` + -Uri "$base/$($entry.name)" ` + -Headers @{ Authorization = $auth } ` + -InFile $entry.path ` + -ContentType 'text/plain' ` + -UseBasicParsing ` + -ErrorAction Stop + Write-Host " HTTP $($resp.StatusCode)" + } catch { + Write-Host " upload failed: $($_.Exception.Message)" + } + } else { + Write-Host "Skip $($entry.path) (not found)" + } + } - name: Test run: dotnet test src/OutlookAddin.Tests/OutlookAddin.Tests.csproj --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"