Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
c23acb4472
|
|||
|
33fcd762f4
|
|||
|
ffbbf42d23
|
|||
| 8599690614 | |||
| 572d328890 | |||
| 10ae32812f | |||
| 39cfe519c6 | |||
| 19a326f8bf | |||
| 8ea5de3f54 | |||
|
992b629e24
|
|||
|
9223d5c5b2
|
|||
|
900cb4c210
|
|||
|
bd1c068e1c
|
|||
|
9afa50820b
|
@@ -1,4 +1,4 @@
|
|||||||
name: Build and Upload Release (Windows EXE from Ubuntu)
|
name: Build and Upload Release (Windows EXE)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@@ -7,55 +7,54 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows-exe:
|
build-windows-exe:
|
||||||
name: Build Windows EXE (PyInstaller via Docker on Ubuntu)
|
name: Build Windows EXE
|
||||||
runs-on: ubuntu-latest
|
runs-on: windows
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Ensure tools (ImageMagick for .ico)
|
- name: Set up Python
|
||||||
run: |
|
uses: actions/setup-python@v5
|
||||||
sudo apt-get update
|
with:
|
||||||
sudo apt-get install -y imagemagick
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Prepare icon (optional)
|
- name: Install dependencies
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
if [ -f "SeaLoader.png" ]; then
|
python -m pip install --upgrade pip
|
||||||
convert SeaLoader.png -resize 256x256 SeaLoader.ico || true
|
if (Test-Path requirements.txt) { pip install -r requirements.txt }
|
||||||
fi
|
pip install pyinstaller
|
||||||
|
|
||||||
- name: Build EXE with PyInstaller (Windows target via Docker)
|
- name: Build EXE with PyInstaller
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -v "$PWD":/src cdrx/pyinstaller-windows:python3 \
|
$ErrorActionPreference = 'Stop'
|
||||||
"/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 )'"
|
# 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
|
- name: Prepare artifact
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist_upload
|
New-Item -ItemType Directory -Force -Path dist_upload | Out-Null
|
||||||
if [ -f dist/windows/SeaLoader.exe ]; then
|
Copy-Item dist\SeaLoader.exe dist_upload\SeaLoader.exe
|
||||||
cp dist/windows/SeaLoader.exe dist_upload/SeaLoader.exe
|
if (Test-Path README.md) { Copy-Item README.md dist_upload\ }
|
||||||
elif [ -f dist/SeaLoader.exe ]; then
|
if (Test-Path LICENSE) { Copy-Item LICENSE dist_upload\ }
|
||||||
cp dist/SeaLoader.exe dist_upload/SeaLoader.exe
|
Compress-Archive -Path dist_upload\* -DestinationPath SeaLoader_Windows_x64.zip -Force
|
||||||
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
|
|
||||||
|
|
||||||
- name: Upload asset to Release
|
- name: Upload asset to Release
|
||||||
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
||||||
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
RELEASE_ID: ${{ github.event.release.id }}
|
RELEASE_ID: ${{ github.event.release.id }}
|
||||||
SERVER_URL: ${{ github.server_url }}
|
SERVER_URL: ${{ github.server_url }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
$ErrorActionPreference = 'Stop'
|
||||||
UPLOAD_URL="$SERVER_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=SeaLoader_Windows_x64.zip"
|
$uploadUrl = "$env:SERVER_URL/api/v1/repos/$env:REPO/releases/$env:RELEASE_ID/assets?name=SeaLoader_Windows_x64.zip"
|
||||||
echo "Uploading asset to $UPLOAD_URL"
|
Write-Host "Uploading asset to $uploadUrl"
|
||||||
curl -fSL -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/zip" \
|
Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers @{ Authorization = "token $env:TOKEN" } -ContentType "application/zip" -InFile "SeaLoader_Windows_x64.zip"
|
||||||
--data-binary @SeaLoader_Windows_x64.zip "$UPLOAD_URL"
|
|
||||||
|
|
||||||
- name: Upload artifact (CI logs)
|
- name: Upload artifact (CI logs)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -63,5 +62,5 @@ jobs:
|
|||||||
name: SeaLoader_Windows_x64
|
name: SeaLoader_Windows_x64
|
||||||
path: |
|
path: |
|
||||||
SeaLoader_Windows_x64.zip
|
SeaLoader_Windows_x64.zip
|
||||||
dist/windows/SeaLoader.exe
|
dist/SeaLoader.exe
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user