Update package-release.yml

This commit is contained in:
phoenixbackrooms
2025-09-13 17:14:45 +03:00
committed by Phoenix
parent ff54c6364a
commit bbe2c70cde

View File

@@ -19,7 +19,7 @@ on:
jobs: jobs:
package-release: package-release:
name: Package Release name: Package Release
runs-on: ubuntu-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -69,145 +69,175 @@ jobs:
continue-on-error: true continue-on-error: true
- name: List downloaded artifacts - name: List downloaded artifacts
shell: powershell
run: | run: |
echo "Downloaded artifacts:" Write-Output "Downloaded artifacts:"
find artifacts/ -type f -name "*" | sort Get-ChildItem -Path artifacts -Recurse -File | Sort-Object FullName
- name: Download UPX for Windows compression - name: Download and setup UPX
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push' if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
shell: powershell
run: | run: |
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
unzip upx-4.2.4-win64.zip Expand-Archive -Path "upx.zip" -DestinationPath "."
chmod +x upx-4.2.4-win64/upx.exe
- name: Setup Wine for running Windows executables
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
run: |
sudo apt-get update
sudo apt-get install -y wine64
- name: Compress Windows Flumi binaries with UPX - name: Compress Windows Flumi binaries with UPX
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push' if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
shell: powershell
run: | run: |
if [ -d "artifacts/flumi-windows" ]; then if (Test-Path "artifacts/flumi-windows") {
echo "Compressing Windows Flumi binaries..." Write-Output "Compressing Windows Flumi binaries..."
# Create build-scripts/Windows structure expected by UPX command
mkdir -p build-scripts/Windows
cp artifacts/flumi-windows/* build-scripts/Windows/
# Run UPX compression using Wine # Create build-scripts/Windows structure
wine ./upx-4.2.4-win64/upx.exe --best --ultra-brute build-scripts/Windows/*.exe build-scripts/Windows/*.dll || echo "UPX compression completed with warnings" New-Item -ItemType Directory -Path "build-scripts/Windows" -Force
Copy-Item "artifacts/flumi-windows/*" "build-scripts/Windows/" -Force
# Run UPX compression
try {
& ".\upx-4.2.4-win64\upx.exe" --best --ultra-brute build-scripts/Windows/*.exe build-scripts/Windows/*.dll
Write-Output "UPX compression completed successfully"
} catch {
Write-Output "UPX compression completed with warnings: $($_.Exception.Message)"
}
# Copy compressed files back # Copy compressed files back
cp build-scripts/Windows/* artifacts/flumi-windows/ Copy-Item "build-scripts/Windows/*" "artifacts/flumi-windows/" -Force
fi }
- name: Setup Inno Setup - name: Download and setup Inno Setup
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push' if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
shell: powershell
run: | run: |
# Download and setup Inno Setup Invoke-WebRequest -Uri "https://files.jrsoftware.org/is/6/innosetup-6.2.2.exe" -OutFile "innosetup.exe"
wget https://jrsoftware.org/download.php/is.exe -O innosetup.exe Start-Process -FilePath ".\innosetup.exe" -ArgumentList "/VERYSILENT", "/NORESTART", "/DIR=C:\InnoSetup" -Wait
wine innosetup.exe /VERYSILENT /NORESTART /DIR="$HOME/.wine/drive_c/InnoSetup"
- name: Build Windows installer - name: Build Windows installer
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push' if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
shell: powershell
run: | run: |
if [ -d "artifacts/flumi-windows" ]; then if (Test-Path "artifacts/flumi-windows") {
echo "Building Windows installer..." Write-Output "Building Windows installer..."
# Setup directory structure for installer # Setup directory structure for installer
mkdir -p build-scripts/Windows New-Item -ItemType Directory -Path "build-scripts/Windows" -Force
cp artifacts/flumi-windows/* build-scripts/Windows/ Copy-Item "artifacts/flumi-windows/*" "build-scripts/Windows/" -Force
# Copy the installer script
cp flumi/build-scripts/flumi-installer.iss build-scripts/
# Create installer output directory # Create installer output directory
mkdir -p build-scripts/Windows/installer New-Item -ItemType Directory -Path "build-scripts/Windows/installer" -Force
# Build installer using Inno Setup # Build installer using your existing .iss file
wine "$HOME/.wine/drive_c/InnoSetup/ISCC.exe" build-scripts/flumi-installer.iss || echo "Installer build completed" $issPath = Resolve-Path "flumi/build-scripts/flumi-installer.iss"
& "C:\InnoSetup\ISCC.exe" $issPath.Path
# Copy installer to artifacts # Copy installer to artifacts if it exists
if [ -f "build-scripts/Windows/installer/Flumi-Setup-1.0.2.exe" ]; then if (Test-Path "build-scripts/Windows/installer/Flumi-Setup-*.exe") {
cp build-scripts/Windows/installer/Flumi-Setup-*.exe artifacts/flumi-windows/ Copy-Item "build-scripts/Windows/installer/Flumi-Setup-*.exe" "artifacts/flumi-windows/" -Force
fi Write-Output "Installer created and copied successfully"
fi } else {
Write-Output "Warning: Installer was not created"
}
}
- name: Prepare release assets - name: Prepare release assets
shell: powershell
run: | run: |
mkdir -p release-assets New-Item -ItemType Directory -Path "release-assets" -Force
# Package Rust binaries (GurtCA + Gurty) # Package Rust binaries (GurtCA + Gurty)
for platform in linux windows; do foreach ($platform in @("linux", "windows")) {
mkdir -p "temp-tools-$platform" $tempDir = "temp-tools-$platform"
New-Item -ItemType Directory -Path $tempDir -Force
# Copy GurtCA if available # Copy GurtCA if available
if [ -d "artifacts/gurtca-$platform" ]; then if (Test-Path "artifacts/gurtca-$platform") {
cp artifacts/gurtca-$platform/* "temp-tools-$platform/" Copy-Item "artifacts/gurtca-$platform/*" $tempDir -Force
fi }
# Copy Gurty if available # Copy Gurty if available
if [ -d "artifacts/gurty-$platform" ]; then if (Test-Path "artifacts/gurty-$platform") {
cp artifacts/gurty-$platform/* "temp-tools-$platform/" Copy-Item "artifacts/gurty-$platform/*" $tempDir -Force
fi }
# Package if we have any files # Package if we have any files
if [ "$(ls -A temp-tools-$platform)" ]; then $files = Get-ChildItem $tempDir -ErrorAction SilentlyContinue
cd "temp-tools-$platform" if ($files.Count -gt 0) {
if [ "$platform" = "windows" ]; then if ($platform -eq "windows") {
zip -r "../release-assets/gurted-tools-$platform.zip" . Compress-Archive -Path "$tempDir/*" -DestinationPath "release-assets/gurted-tools-$platform.zip" -Force
else } else {
tar -czf "../release-assets/gurted-tools-$platform.tar.gz" . # For Linux files, we'll use 7zip if available, otherwise skip tar.gz creation on Windows
fi if (Get-Command "7z" -ErrorAction SilentlyContinue) {
cd .. & "7z" a -ttar "release-assets/gurted-tools-$platform.tar" "$tempDir/*"
fi & "7z" a -tgzip "release-assets/gurted-tools-$platform.tar.gz" "release-assets/gurted-tools-$platform.tar"
Remove-Item "release-assets/gurted-tools-$platform.tar" -Force
} else {
# Fallback to zip for Linux binaries too
Compress-Archive -Path "$tempDir/*" -DestinationPath "release-assets/gurted-tools-$platform.zip" -Force
}
}
}
rm -rf "temp-tools-$platform" Remove-Item $tempDir -Recurse -Force -ErrorAction SilentlyContinue
done }
# Package Flumi builds # Package Flumi builds
for platform in linux windows; do foreach ($platform in @("linux", "windows")) {
if [ -d "artifacts/flumi-$platform" ]; then if (Test-Path "artifacts/flumi-$platform") {
cd "artifacts/flumi-$platform" Push-Location "artifacts/flumi-$platform"
# For Windows, create both compressed binaries package and installer if ($platform -eq "windows") {
if [ "$platform" = "windows" ]; then # Create compressed binaries package (exclude installer files)
# Create compressed binaries package $filesToZip = Get-ChildItem -Exclude "Flumi-Setup-*.exe"
zip -r "../../release-assets/flumi-$platform-binaries.zip" . --exclude="*.exe" # Exclude installer from binaries if ($filesToZip.Count -gt 0) {
Compress-Archive -Path $filesToZip -DestinationPath "../../release-assets/flumi-$platform-binaries.zip" -Force
}
# Copy installer separately if it exists # Copy installer separately if it exists
if ls Flumi-Setup-*.exe 1> /dev/null 2>&1; then $installer = Get-ChildItem "Flumi-Setup-*.exe" -ErrorAction SilentlyContinue
cp Flumi-Setup-*.exe "../../release-assets/" if ($installer) {
fi Copy-Item $installer "../../release-assets/" -Force
else }
tar -czf "../../release-assets/flumi-$platform.tar.gz" . } else {
fi if (Get-Command "7z" -ErrorAction SilentlyContinue) {
cd ../.. & "7z" a -ttar "../../release-assets/flumi-$platform.tar" "*"
fi & "7z" a -tgzip "../../release-assets/flumi-$platform.tar.gz" "../../release-assets/flumi-$platform.tar"
done Remove-Item "../../release-assets/flumi-$platform.tar" -Force
} else {
Compress-Archive -Path "*" -DestinationPath "../../release-assets/flumi-$platform.zip" -Force
}
}
Pop-Location
}
}
# Package GDExtension separately for developers # Package GDExtension separately for developers
for platform in linux windows; do foreach ($platform in @("linux", "windows")) {
if [ -d "artifacts/gdextension-$platform" ]; then if (Test-Path "artifacts/gdextension-$platform") {
cd "artifacts/gdextension-$platform" Push-Location "artifacts/gdextension-$platform"
if [ "$platform" = "windows" ]; then if ($platform -eq "windows") {
zip -r "../../release-assets/gdextension-$platform.zip" . Compress-Archive -Path "*" -DestinationPath "../../release-assets/gdextension-$platform.zip" -Force
else } else {
tar -czf "../../release-assets/gdextension-$platform.tar.gz" . if (Get-Command "7z" -ErrorAction SilentlyContinue) {
fi & "7z" a -ttar "../../release-assets/gdextension-$platform.tar" "*"
cd ../.. & "7z" a -tgzip "../../release-assets/gdextension-$platform.tar.gz" "../../release-assets/gdextension-$platform.tar"
fi Remove-Item "../../release-assets/gdextension-$platform.tar" -Force
done } else {
Compress-Archive -Path "*" -DestinationPath "../../release-assets/gdextension-$platform.zip" -Force
}
}
Pop-Location
}
}
- name: Get release tag - name: Get release tag
id: get_tag id: get_tag
shell: powershell
run: | run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then if ("${{ github.event_name }}" -eq "workflow_dispatch") {
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT echo "tag=${{ github.event.inputs.tag }}" >> $env:GITHUB_OUTPUT
else } else {
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT $tag = "${{ github.ref }}" -replace "refs/tags/", ""
fi echo "tag=$tag" >> $env:GITHUB_OUTPUT
}
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
@@ -224,11 +254,11 @@ jobs:
- **GDExtension**: Godot extension for GURT protocol integration - **GDExtension**: Godot extension for GURT protocol integration
### Downloads ### Downloads
- `gurted-tools-*.zip/tar.gz`: Contains GurtCA and Gurty binaries - `gurted-tools-*.zip`: Contains GurtCA and Gurty binaries
- `flumi-linux.tar.gz`: Contains the Flumi wayfinder application for Linux - `flumi-linux.*`: Contains the Flumi wayfinder application for Linux
- `flumi-windows-binaries.zip`: Contains compressed Flumi binaries for Windows - `flumi-windows-binaries.zip`: Contains compressed Flumi binaries for Windows
- `Flumi-Setup-*.exe`: Windows installer for Flumi (recommended for Windows users) - `Flumi-Setup-*.exe`: Windows installer for Flumi (recommended for Windows users)
- `gdextension-*.zip/tar.gz`: Contains the GDExtension library for developers - `gdextension-*.zip`: Contains the GDExtension library for developers
### Platform Support ### Platform Support
- Linux (x86_64) - Linux (x86_64)