update workflow to for this project
Some checks failed
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Failing after 2m35s
Some checks failed
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Failing after 2m35s
This commit is contained in:
@@ -16,7 +16,22 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Create .env file from secrets
|
||||
shell: powershell
|
||||
run: |
|
||||
$envContent = @"
|
||||
# Default Collection URLs
|
||||
CORE_COLLECTION_URL=${{ secrets.CORE_COLLECTION_URL || 'https://steamcommunity.com/workshop/filedetails/?id=3521297585' }}
|
||||
CONTENT_COLLECTION_URL=${{ secrets.CONTENT_COLLECTION_URL || 'steam://openurl/https://steamcommunity.com/sharedfiles/filedetails/?id=3521319712' }}
|
||||
COSMETICS_COLLECTION_URL=${{ secrets.COSMETICS_COLLECTION_URL || 'steam://openurl/https://steamcommunity.com/sharedfiles/filedetails/?id=3637541646' }}
|
||||
|
||||
# ModsConfig.xml Path Template
|
||||
MODSCONFIG_PATH_TEMPLATE=${{ secrets.MODSCONFIG_PATH_TEMPLATE || '%USERPROFILE%\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config\ModsConfig.xml' }}
|
||||
"@
|
||||
$envContent | Out-File -FilePath .env -Encoding UTF8 -Force
|
||||
Write-Host "Created .env file with configuration"
|
||||
|
||||
- name: Install dependencies
|
||||
shell: powershell
|
||||
@@ -29,28 +44,14 @@ jobs:
|
||||
shell: powershell
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
# Stamp version into sealoader_version.py from release tag
|
||||
if ($env:GITHUB_EVENT_NAME -eq 'release') {
|
||||
$tag = '${{ github.event.release.tag_name }}'
|
||||
} else {
|
||||
$tag = (git describe --tags --always) 2>$null
|
||||
if (-not $tag) { $tag = "0.0.0-dev" }
|
||||
}
|
||||
("__version__ = '" + $tag + "'") | Out-File -FilePath sealoader_version.py -Encoding UTF8 -Force
|
||||
# Bundle PNG resources referenced at runtime
|
||||
pyinstaller --noconfirm --onefile --windowed sealoader_gui.py --name SeaLoader `
|
||||
--add-data "SeaLoader.png;." `
|
||||
--add-data "hrsys.png;." `
|
||||
--icon SeaLoader.ico
|
||||
# Build standalone executable with all assets bundled
|
||||
pyinstaller --clean --onefile --windowed --icon=art/Progression.ico --add-data "art;art" --add-data ".env;." --name ProgressionLoader steam_workshop_gui.py
|
||||
|
||||
- name: Prepare artifact
|
||||
shell: powershell
|
||||
run: |
|
||||
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
|
||||
# Just upload the standalone .exe file
|
||||
Copy-Item dist\ProgressionLoader.exe ProgressionLoader.exe
|
||||
|
||||
- name: Upload asset to Release
|
||||
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
||||
@@ -62,9 +63,7 @@ jobs:
|
||||
SERVER_URL: ${{ github.server_url }}
|
||||
run: |
|
||||
$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"
|
||||
|
||||
# CI artifact upload removed for GHES compatibility
|
||||
$uploadUrl = "$env:SERVER_URL/api/v1/repos/$env:REPO/releases/$env:RELEASE_ID/assets?name=ProgressionLoader.exe"
|
||||
Write-Host "Uploading ProgressionLoader.exe to $uploadUrl"
|
||||
Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers @{ Authorization = "token $env:TOKEN" } -ContentType "application/octet-stream" -InFile "ProgressionLoader.exe"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user