Files
LOGAR/.gitea/workflows/release.yml
T
me0nline f7584320f9
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 42s
ci: harden debian container package installation and pip bootstrapping against stale apt mirror lists
2026-09-25 22:27:50 +02:00

136 lines
5.3 KiB
YAML

name: Release Binaries & Installers
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish assets to (default: v2.0.1)'
required: false
default: 'v2.0.1'
jobs:
release-linux:
name: Build & Release Linux Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Python and Build Dependencies
run: |
if command -v apt-get >/dev/null 2>&1; then
export DEBIAN_FRONTEND=noninteractive
if [ -f /etc/apt/sources.list ]; then
sed -i 's|deb.debian.org/debian-security bullseye-security|security.debian.org/debian-security bullseye-security|g' /etc/apt/sources.list 2>/dev/null || true
fi
rm -rf /var/lib/apt/lists/*
apt-get update -y || apt-get update --fix-missing -y || true
apt-get install -y --no-install-recommends python3 python3-pip python3-venv binutils zip curl || apt-get install -y --fix-missing python3 python3-pip python3-venv binutils zip curl || true
fi
if ! command -v pip3 >/dev/null 2>&1 && ! python3 -m pip --version >/dev/null 2>&1; then
if command -v curl >/dev/null 2>&1; then
curl -sS https://bootstrap.pypa.io/get-pip.py | python3 || true
fi
fi
python3 -m pip install --upgrade pip --break-system-packages || python3 -m pip install --upgrade pip || true
python3 -m pip install pyinstaller -r compilation/requirements.txt --break-system-packages || python3 -m pip install pyinstaller -r compilation/requirements.txt || pip3 install pyinstaller -r compilation/requirements.txt
- name: Compile Standalone Linux Binaries
run: |
python3 compilation/package_dist.py --target linux
- name: Publish Linux Release Assets
env:
GITEA_TOKEN: ${{ secrets.TAG_TOKEN || github.token }}
GITEA_SERVER_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_REF_NAME: ${{ inputs.tag || github.event.release.tag_name || github.ref_name }}
run: |
python3 compilation/upload_release.py --skip-build
release-windows:
name: Build & Release Windows Binaries & Installers
# Note: Requires a registered Gitea Act Runner with label 'windows-latest'
runs-on: windows-latest
steps:
- name: Checkout Repository
shell: powershell
run: |
$server = "${{ github.server_url }}"
$token = "${{ secrets.TAG_TOKEN || github.token }}"
$repo = "${{ github.repository }}"
$cleanUrl = $server -replace "^https?://", ""
$authUrl = "https://${token}@${cleanUrl}/${repo}.git"
if (-not (Test-Path ".git")) {
git init
git remote add origin $authUrl
} else {
git remote set-url origin $authUrl
}
git fetch --depth 1 origin "${{ github.sha }}"
git checkout -f FETCH_HEAD
- name: Install Dependencies
shell: powershell
run: |
$py = "python"
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
if (Get-Command "py" -ErrorAction SilentlyContinue) {
$py = "py -3.12"
}
}
& $py -m pip install --upgrade pip
& $py -m pip install pyinstaller cryptography -r compilation/requirements.txt
- name: Compile Standalone Windows Binaries
shell: powershell
run: |
$py = "python"
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
if (Get-Command "py" -ErrorAction SilentlyContinue) {
$py = "py -3.12"
}
}
& $py compilation/package_dist.py --target windows
- name: Compile Inno Setup Installers
shell: powershell
run: |
$iscc = $null
if (Test-Path "C:\Program Files (x86)\Inno Setup 6\ISCC.exe") {
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
} elseif (Test-Path "C:\Program Files\Inno Setup 6\ISCC.exe") {
$iscc = "C:\Program Files\Inno Setup 6\ISCC.exe"
} elseif (Get-Command "ISCC.exe" -ErrorAction SilentlyContinue) {
$iscc = "ISCC.exe"
}
if ($iscc) {
Write-Host "[*] Compiling Windows Inno Setup installers using $iscc..."
& $iscc compilation/installer_client.iss
& $iscc compilation/installer_server.iss
} else {
Write-Host "[!] Inno Setup compiler (ISCC.exe) not found on runner host. Skipping installer compilation."
}
- name: Publish Windows Release Assets
shell: powershell
env:
GITEA_TOKEN: ${{ secrets.TAG_TOKEN || github.token }}
GITEA_SERVER_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_REF_NAME: ${{ inputs.tag || github.event.release.tag_name || github.ref_name }}
run: |
$py = "python"
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
if (Get-Command "py" -ErrorAction SilentlyContinue) {
$py = "py -3.12"
}
}
& $py compilation/upload_release.py --skip-build