From 3184b39d5c2f118a371a6c9cbfdc69eb808fd32e Mon Sep 17 00:00:00 2001 From: MrSphay Date: Fri, 1 May 2026 13:07:31 +0200 Subject: [PATCH] Use available Gitea runner for Windows build --- .gitea/workflows/build-windows.yml | 34 ++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml index 7b7e0ea..e7c5a4b 100644 --- a/.gitea/workflows/build-windows.yml +++ b/.gitea/workflows/build-windows.yml @@ -9,7 +9,7 @@ on: jobs: build-windows: - runs-on: windows-latest + runs-on: ubuntu-latest env: GH_TOKEN: ${{ secrets.REGISTRY_TOKEN }} GITHUB_TOKEN: ${{ secrets.REGISTRY_TOKEN }} @@ -24,6 +24,18 @@ jobs: node-version: 22 registry-url: https://registry.npmjs.org + - name: Install Windows build dependencies + run: | + if command -v sudo >/dev/null 2>&1; then + SUDO=sudo + else + SUDO= + fi + + $SUDO dpkg --add-architecture i386 + $SUDO apt-get update + $SUDO apt-get install -y --no-install-recommends wine64 wine32 + - name: Install dependencies run: npm install @@ -37,15 +49,15 @@ jobs: path: release/* - name: Publish to Gitea package registry - shell: pwsh + shell: bash run: | - $package = Get-Content package.json | ConvertFrom-Json - $shortSha = $env:GITHUB_SHA.Substring(0, 7) - $packageVersion = "$($package.version)-$shortSha" - $headers = @{ Authorization = "token $env:REGISTRY_TOKEN" } + package_version="$(node -p "require('./package.json').version")-${GITHUB_SHA::7}" - Get-ChildItem release -File | ForEach-Object { - $fileName = [System.Uri]::EscapeDataString($_.Name) - $uri = "https://git.wilkensxl.de/api/packages/MrSphay/generic/envhelper/$packageVersion/$fileName" - Invoke-RestMethod -Method Put -Uri $uri -Headers $headers -InFile $_.FullName -ContentType "application/octet-stream" - } + for artifact in release/*; do + [ -f "$artifact" ] || continue + file_name="$(basename "$artifact")" + curl --fail-with-body \ + --user "MrSphay:${REGISTRY_TOKEN}" \ + --upload-file "$artifact" \ + "https://git.wilkensxl.de/api/packages/MrSphay/generic/envhelper/${package_version}/${file_name}" + done