Configure separate Windows and Linux Gitea release workflows with dedicated SHA-256 checksums
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 3m48s

This commit is contained in:
2026-09-04 15:46:35 +02:00
parent e7bf277fb9
commit 082b839965
6 changed files with 312 additions and 95 deletions
+50 -15
View File
@@ -175,7 +175,8 @@ LOGAR/
├── .gitea/
│ └── workflows/
│ ├── ci.yml # Continuous Integration automated test suite (runs on every push)
── release.yml # Automated standalone binary release workflow (runs on tag v*)
── release-linux.yml # Linux release workflow (compiles Server.bin, Linux_Client.bin, checksums)
│ └── release-windows.yml # Windows release workflow (compiles Server.exe, Win_Client.exe, checksums)
├── .gitignore # Ignore venv, caches, DBs, and private keys
├── requirements.txt # Unified dependencies
├── README.md # Comprehensive documentation
@@ -308,7 +309,9 @@ Continuous integration is automated via [`.gitea/workflows/ci.yml`](.gitea/workf
## Automated Releases via Gitea Actions
Release builds are automated via [`.gitea/workflows/release.yml`](.gitea/workflows/release.yml) using your Gitea action runner:
Release builds are automated via two dedicated Gitea Actions workflows running concurrently on native platform runners:
- [`.gitea/workflows/release-linux.yml`](.gitea/workflows/release-linux.yml) (`ubuntu-latest`)
- [`.gitea/workflows/release-windows.yml`](.gitea/workflows/release-windows.yml) (`windows-latest`)
### Publishing a Release
Whenever you want to release a new version with compiled standalone binaries:
@@ -316,22 +319,54 @@ Whenever you want to release a new version with compiled standalone binaries:
git tag v1.0.1
git push origin v1.0.1
```
*(You can also trigger builds manually via the Gitea UI using the **Run workflow** button (`workflow_dispatch`) on either workflow).*
### What Gitea Actions Does Automatically:
1. Gitea runner executes the workflow on tag push.
2. Installs Python, system build tools (`binutils`, `zip`), PyInstaller, and project dependencies via `apt-get` and `pip3`.
3. Runs `package_dist.py` to compile standalone binaries:
- `Linux_Client.bin` (native ELF binary compiled with PyInstaller)
- `Server.bin` (native server ELF binary compiled with PyInstaller)
- `Win_Client.pyz` (standalone executable zipapp)
- `SHA256SUMS.txt` (SHA-256 cryptographic checksums)
4. Publishes the Gitea release directly via Python (`python3 upload_release.py --skip-build`) using the Gitea REST API to attach the compiled binary assets (avoiding runner Node runtime limitations).
### Automated Multi-Platform Compilation:
1. **Linux Runner** (`release-linux.yml`):
- Compiles native Linux ELF executables: `Linux_Client.bin` and `Server.bin`.
- Generates dedicated SHA-256 checksum files:
- `linux_client_sha256sum` (verification for `Linux_Client.bin`)
- `linux_agent_sha256sum` (alias for client/agent integrations)
- `linux_server_sha256sum` (verification for `Server.bin`)
- `SHA256SUMS_linux.txt` (summary manifest)
- Attaches all Linux assets to the Gitea release.
### Building & Publishing Windows Executables (`.exe`) Locally
Because the Linux Gitea runner compiles ELF binaries, native Windows PE executables (`Win_Client.exe`, `Server.exe`) can be built and published directly from a Windows workstation:
2. **Windows Runner** (`release-windows.yml`):
- Compiles native Windows PE executables: `Win_Client.exe` and `Server.exe`.
- Generates dedicated SHA-256 checksum files:
- `win_client_sha256sum` (verification for `Win_Client.exe`)
- `win_agent_sha256sum` (alias for client/agent integrations)
- `win_server_sha256sum` (verification for `Server.exe`)
- `SHA256SUMS_windows.txt` (summary manifest)
- Attaches all Windows assets to the Gitea release.
3. **Concurrent Publishing & Conflict Handling**:
`upload_release.py` includes automatic retry and conflict resolution so concurrent Windows and Linux runners attach their respective assets to the release without collision.
### Verifying Checksums
- On Linux:
```bash
sha256sum -c linux_client_sha256sum
# or
sha256sum -c linux_server_sha256sum
```
- On Windows (PowerShell):
```powershell
Get-FileHash .\Win_Client.exe -Algorithm SHA256
Get-Content .\win_client_sha256sum
```
### Local Packaging & Manual Upload
You can also compile and package binaries locally anytime:
```bash
# Windows
py -3.12 package_dist.py --target windows
# Linux
python3 package_dist.py --target linux
```
To upload local builds directly to Gitea:
```powershell
# Compiles Win_Client.exe, Server.exe, Linux_Client.bin, and uploads to Gitea
python upload_release.py --tag v1.0.0 --token <YOUR_GITEA_TOKEN>
python upload_release.py --tag v1.0.1 --token <YOUR_GITEA_TOKEN>
```
*(Environment variables `GITEA_TOKEN`, `GITEA_SERVER_URL`, `GITEA_REPOSITORY`, and `GITEA_REF_NAME` are also supported automatically).*