ci: push build logs to Gitea generic package registry

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:27:11 +00:00
parent 8c583aaa3c
commit 3b07558bf6
+35 -11
View File
@@ -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"