238 lines
9.0 KiB
YAML
238 lines
9.0 KiB
YAML
name: Package Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Release tag'
|
|
required: true
|
|
default: 'v1.0.2'
|
|
download_artifacts:
|
|
description: 'Download latest artifacts from main branch'
|
|
required: false
|
|
default: 'true'
|
|
type: boolean
|
|
|
|
jobs:
|
|
package-release:
|
|
name: Package Release
|
|
runs-on: windows-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
|
|
shell: powershell
|
|
run: |
|
|
Write-Output "Downloaded artifacts:"
|
|
Get-ChildItem -Path artifacts -Recurse -File | Sort-Object FullName
|
|
|
|
- name: Download and setup UPX
|
|
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
|
|
shell: powershell
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
|
|
Expand-Archive -Path "upx.zip" -DestinationPath "."
|
|
|
|
- name: Compress Windows Flumi binaries with UPX
|
|
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
|
|
shell: powershell
|
|
run: |
|
|
if (Test-Path "artifacts/flumi-windows") {
|
|
Write-Output "Compressing Windows Flumi binaries..."
|
|
|
|
# Create build-scripts/Windows structure
|
|
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" --lzma --best 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-Item "build-scripts/Windows/*" "artifacts/flumi-windows/" -Force
|
|
}
|
|
|
|
- name: Download and setup Inno Setup
|
|
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
|
|
shell: powershell
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://files.jrsoftware.org/is/6/innosetup-6.5.3.exe" -OutFile "innosetup.exe"
|
|
Start-Process -FilePath ".\innosetup.exe" -ArgumentList "/VERYSILENT", "/NORESTART", "/DIR=C:\InnoSetup" -Wait
|
|
|
|
- name: Build Windows installer
|
|
if: github.event.inputs.download_artifacts == 'true' || github.event_name == 'push'
|
|
shell: powershell
|
|
run: |
|
|
if (Test-Path "artifacts\flumi-windows") {
|
|
Write-Output "Building Windows installer..."
|
|
|
|
# Ensure the path relative to the .iss exists
|
|
New-Item -ItemType Directory -Path "flumi\build-scripts\Windows" -Force | Out-Null
|
|
|
|
# Copy files from artifacts into flumi\build-scripts\Windows (robust enumeration)
|
|
Get-ChildItem -Path "artifacts\flumi-windows" -File | ForEach-Object {
|
|
Copy-Item -Path $_.FullName -Destination "flumi\build-scripts\Windows" -Force
|
|
}
|
|
|
|
# Ensure installer output dir matches OutputDir=Windows\installer in .iss
|
|
New-Item -ItemType Directory -Path "flumi\build-scripts\Windows\installer" -Force | Out-Null
|
|
|
|
# Compile using .iss (paths resolved relative to flumi/build-scripts)
|
|
$issPath = Resolve-Path "flumi\build-scripts\flumi-installer.iss"
|
|
& "C:\InnoSetup\ISCC.exe" $issPath.Path
|
|
|
|
# Copy installer to artifacts
|
|
$built = Get-ChildItem "flumi\build-scripts\Windows\installer" -Filter "Flumi-Setup-*.exe" -ErrorAction SilentlyContinue
|
|
if ($built) {
|
|
Copy-Item $built.FullName "artifacts\flumi-windows" -Force
|
|
Write-Output "Installer created and copied successfully"
|
|
} else {
|
|
Write-Output "Warning: Installer was not created"
|
|
}
|
|
}
|
|
- name: Prepare release assets
|
|
shell: powershell
|
|
run: |
|
|
New-Item -ItemType Directory -Path "release-assets" -Force
|
|
|
|
# Copy Rust binaries directly (GurtCA + Gurty)
|
|
foreach ($platform in @("linux", "windows")) {
|
|
# Copy GurtCA binaries
|
|
if (Test-Path "artifacts/gurtca-$platform") {
|
|
Get-ChildItem "artifacts/gurtca-$platform" -File | ForEach-Object {
|
|
$newName = $_.BaseName
|
|
Copy-Item $_.FullName "release-assets/$newName" -Force
|
|
}
|
|
}
|
|
|
|
# Copy Gurty binaries
|
|
if (Test-Path "artifacts/gurty-$platform") {
|
|
Get-ChildItem "artifacts/gurty-$platform" -File | ForEach-Object {
|
|
$newName = $_.BaseName
|
|
Copy-Item $_.FullName "release-assets/$newName" -Force
|
|
}
|
|
}
|
|
}
|
|
|
|
# Package Flumi builds
|
|
foreach ($platform in @("linux", "windows")) {
|
|
if (Test-Path "artifacts/flumi-$platform") {
|
|
Push-Location "artifacts/flumi-$platform"
|
|
|
|
if ($platform -eq "windows") {
|
|
|
|
# Copy installer separately if it exists
|
|
$installer = Get-ChildItem "Flumi-Setup-*.exe" -ErrorAction SilentlyContinue
|
|
if ($installer) {
|
|
Copy-Item $installer "../../release-assets/" -Force
|
|
}
|
|
} else {
|
|
if (Get-Command "7z" -ErrorAction SilentlyContinue) {
|
|
& "7z" a -ttar "../../release-assets/flumi-$platform.tar" "*"
|
|
& "7z" a -tgzip "../../release-assets/flumi-$platform.tar.gz" "../../release-assets/flumi-$platform.tar"
|
|
Remove-Item "../../release-assets/flumi-$platform.tar" -Force
|
|
} else {
|
|
Compress-Archive -Path "*" -DestinationPath "../../release-assets/flumi-$platform.zip" -Force
|
|
}
|
|
}
|
|
Pop-Location
|
|
}
|
|
}
|
|
|
|
|
|
- name: Get release tag
|
|
id: get_tag
|
|
shell: powershell
|
|
run: |
|
|
if ("${{ github.event_name }}" -eq "workflow_dispatch") {
|
|
echo "tag=${{ github.event.inputs.tag }}" >> $env:GITHUB_OUTPUT
|
|
} else {
|
|
$tag = "${{ github.ref }}" -replace "refs/tags/", ""
|
|
echo "tag=$tag" >> $env:GITHUB_OUTPUT
|
|
}
|
|
|
|
- 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 browser for the GURT ecosystem
|
|
|
|
### Downloads
|
|
- `gurtca`: GurtCA binaries for Linux
|
|
- `gurty`: Gurty binaries for Linux
|
|
- `gurtca`: GurtCA binaries for Windows
|
|
- `gurty`: Gurty binaries for Windows
|
|
- `flumi-linux.*`: Contains the Flumi browser for Linux
|
|
- `Flumi-Setup-*.exe`: Windows installer for Flumi
|
|
|
|
### Platform Support
|
|
- Linux (x86_64)
|
|
- Windows (x86_64)
|
|
|
|
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 }}
|
|
|