Files
leonwww/.github/workflows/package-release.yml
2025-09-17 20:23:02 +03:00

246 lines
9.1 KiB
YAML

name: Package Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
default: 'v0.1.0'
download_artifacts:
description: 'Download latest artifacts from main branch'
required: false
default: 'true'
type: boolean
jobs:
package-release:
name: Package Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download GurtCA artifacts
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-gurtca.yml
name_is_regexp: true
name: gurtca-.*
path: artifacts/
if_no_artifact_found: warn
continue-on-error: true
- name: Download Gurty artifacts
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-gurty.yml
name_is_regexp: true
name: gurty-.*
path: artifacts/
if_no_artifact_found: warn
continue-on-error: true
- name: Download GDExtension artifacts
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-gdextension.yml
name_is_regexp: true
name: gdextension-.*
path: artifacts/
if_no_artifact_found: warn
continue-on-error: true
- name: Download Flumi artifacts
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-flumi.yml
name_is_regexp: true
name: flumi-.*
path: artifacts/
if_no_artifact_found: warn
continue-on-error: true
- name: List downloaded artifacts
run: |
echo "Downloaded artifacts:"
find artifacts/ -type f -name "*" | sort
- name: Download UPX for Windows compression
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
run: |
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip
unzip upx-4.2.4-win64.zip
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
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
run: |
if [ -d "artifacts/flumi-windows" ]; then
echo "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
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"
# Copy compressed files back
cp build-scripts/Windows/* artifacts/flumi-windows/
fi
- name: Setup Inno Setup
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
run: |
# Download and setup Inno Setup
wget https://jrsoftware.org/download.php/is.exe -O innosetup.exe
wine innosetup.exe /VERYSILENT /NORESTART /DIR="$HOME/.wine/drive_c/InnoSetup"
- name: Build Windows installer
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
run: |
if [ -d "artifacts/flumi-windows" ]; then
echo "Building Windows installer..."
# Setup directory structure for installer
mkdir -p build-scripts/Windows
cp artifacts/flumi-windows/* build-scripts/Windows/
# Copy the installer script
cp flumi/build-scripts/flumi-installer.iss build-scripts/
# Create installer output directory
mkdir -p build-scripts/Windows/installer
# Build installer using Inno Setup
wine "$HOME/.wine/drive_c/InnoSetup/ISCC.exe" build-scripts/flumi-installer.iss || echo "Installer build completed"
# Copy installer to artifacts
if [ -f "build-scripts/Windows/installer/Flumi-Setup-1.0.2.exe" ]; then
cp build-scripts/Windows/installer/Flumi-Setup-*.exe artifacts/flumi-windows/
fi
fi
- name: Prepare release assets
run: |
mkdir -p release-assets
# Package Rust binaries (GurtCA + Gurty)
for platform in linux windows; do
mkdir -p "temp-tools-$platform"
# Copy GurtCA if available
if [ -d "artifacts/gurtca-$platform" ]; then
cp artifacts/gurtca-$platform/* "temp-tools-$platform/"
fi
# Copy Gurty if available
if [ -d "artifacts/gurty-$platform" ]; then
cp artifacts/gurty-$platform/* "temp-tools-$platform/"
fi
# Package if we have any files
if [ "$(ls -A temp-tools-$platform)" ]; then
cd "temp-tools-$platform"
if [ "$platform" = "windows" ]; then
zip -r "../release-assets/gurted-tools-$platform.zip" .
else
tar -czf "../release-assets/gurted-tools-$platform.tar.gz" .
fi
cd ..
fi
rm -rf "temp-tools-$platform"
done
# Package Flumi builds
for platform in linux windows; do
if [ -d "artifacts/flumi-$platform" ]; then
cd "artifacts/flumi-$platform"
# For Windows, create both compressed binaries package and installer
if [ "$platform" = "windows" ]; then
# Create compressed binaries package
zip -r "../../release-assets/flumi-$platform-binaries.zip" . --exclude="*.exe" # Exclude installer from binaries
# Copy installer separately if it exists
if ls Flumi-Setup-*.exe 1> /dev/null 2>&1; then
cp Flumi-Setup-*.exe "../../release-assets/"
fi
else
tar -czf "../../release-assets/flumi-$platform.tar.gz" .
fi
cd ../..
fi
done
# Package GDExtension separately for developers
for platform in linux windows; do
if [ -d "artifacts/gdextension-$platform" ]; then
cd "artifacts/gdextension-$platform"
if [ "$platform" = "windows" ]; then
zip -r "../../release-assets/gdextension-$platform.zip" .
else
tar -czf "../../release-assets/gdextension-$platform.tar.gz" .
fi
cd ../..
fi
done
- name: Get release tag
id: get_tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
name: Gurted ${{ steps.get_tag.outputs.tag }}
body: |
## Gurted Release ${{ steps.get_tag.outputs.tag }}
This release includes:
- **GurtCA**: Certificate Authority for TLS certificates
- **Gurty**: CLI tool for managing GURT protocol servers
- **Flumi**: The official wayfinder (browser) for the GURT ecosystem
- **GDExtension**: Godot extension for GURT protocol integration
### Downloads
- `gurted-tools-*.zip/tar.gz`: Contains GurtCA and Gurty binaries
- `flumi-linux.tar.gz`: Contains the Flumi wayfinder application for Linux
- `flumi-windows-binaries.zip`: Contains compressed Flumi binaries for Windows
- `Flumi-Setup-*.exe`: Windows installer for Flumi (recommended for Windows users)
- `gdextension-*.zip/tar.gz`: Contains the GDExtension library for developers
### Platform Support
- Linux (x86_64)
- Windows (x86_64)
### Windows Users
For the best experience on Windows, download and run the `Flumi-Setup-*.exe` installer.
For documentation and usage instructions, visit [docs.gurted.com](https://docs.gurted.com)
files: release-assets/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}