From 8599690614dc1279cb4e05007469e49b7237a235 Mon Sep 17 00:00:00 2001 From: HRiggs Date: Tue, 16 Sep 2025 17:43:50 +0000 Subject: [PATCH] revert a51f341cf36d97aa8ce824497fe3973f8935e692 revert Attempt ubuntu action --- .gitea/workflows/release.yml | 61 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3524360..f131a82 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,4 +1,4 @@ -name: Build and Upload Release (Windows EXE from Ubuntu) +name: Build and Upload Release (Windows EXE) on: release: @@ -7,55 +7,54 @@ on: jobs: build-windows-exe: - name: Build Windows EXE (PyInstaller via Docker on Ubuntu) - runs-on: ubuntu-latest + name: Build Windows EXE + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Ensure tools (ImageMagick for .ico) - run: | - sudo apt-get update - sudo apt-get install -y imagemagick + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' - - name: Prepare icon (optional) + - name: Install dependencies + shell: pwsh run: | - if [ -f "SeaLoader.png" ]; then - convert SeaLoader.png -resize 256x256 SeaLoader.ico || true - fi + python -m pip install --upgrade pip + if (Test-Path requirements.txt) { pip install -r requirements.txt } + pip install pyinstaller - - name: Build EXE with PyInstaller (Windows target via Docker) + - name: Build EXE with PyInstaller + shell: pwsh run: | - docker run --rm -v "$PWD":/src cdrx/pyinstaller-windows:python3 \ - "/bin/sh -lc 'set -e; if [ -f requirements.txt ]; then pip install -r requirements.txt; fi; pyinstaller --noconfirm --onefile --windowed sealoader_gui.py --name SeaLoader --add-data ""SeaLoader.png;."" $( [ -f SeaLoader.ico ] && echo --icon SeaLoader.ico )'" + $ErrorActionPreference = 'Stop' + # Include SeaLoader.png so the packaged app icon in-app works + $addData = "SeaLoader.png;." # Windows uses ';' for --add-data + pyinstaller --noconfirm --onefile --windowed sealoader_gui.py --name SeaLoader --add-data "$addData" - name: Prepare artifact + shell: pwsh run: | - mkdir -p dist_upload - if [ -f dist/windows/SeaLoader.exe ]; then - cp dist/windows/SeaLoader.exe dist_upload/SeaLoader.exe - elif [ -f dist/SeaLoader.exe ]; then - cp dist/SeaLoader.exe dist_upload/SeaLoader.exe - else - echo "SeaLoader.exe not found" && ls -R dist || true && exit 1 - fi - [ -f README.md ] && cp README.md dist_upload/ || true - [ -f LICENSE ] && cp LICENSE dist_upload/ || true - zip -r9 SeaLoader_Windows_x64.zip dist_upload + New-Item -ItemType Directory -Force -Path dist_upload | Out-Null + Copy-Item dist\SeaLoader.exe dist_upload\SeaLoader.exe + if (Test-Path README.md) { Copy-Item README.md dist_upload\ } + if (Test-Path LICENSE) { Copy-Item LICENSE dist_upload\ } + Compress-Archive -Path dist_upload\* -DestinationPath SeaLoader_Windows_x64.zip -Force - name: Upload asset to Release if: ${{ github.event_name == 'release' && github.event.action == 'published' }} + shell: pwsh env: TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} RELEASE_ID: ${{ github.event.release.id }} SERVER_URL: ${{ github.server_url }} run: | - set -e - UPLOAD_URL="$SERVER_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=SeaLoader_Windows_x64.zip" - echo "Uploading asset to $UPLOAD_URL" - curl -fSL -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/zip" \ - --data-binary @SeaLoader_Windows_x64.zip "$UPLOAD_URL" + $ErrorActionPreference = 'Stop' + $uploadUrl = "$env:SERVER_URL/api/v1/repos/$env:REPO/releases/$env:RELEASE_ID/assets?name=SeaLoader_Windows_x64.zip" + Write-Host "Uploading asset to $uploadUrl" + Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers @{ Authorization = "token $env:TOKEN" } -ContentType "application/zip" -InFile "SeaLoader_Windows_x64.zip" - name: Upload artifact (CI logs) uses: actions/upload-artifact@v4 @@ -63,5 +62,5 @@ jobs: name: SeaLoader_Windows_x64 path: | SeaLoader_Windows_x64.zip - dist/windows/SeaLoader.exe + dist/SeaLoader/SeaLoader.exe