Configure Gitea Actions release workflow to compile and publish standalone binaries via runner
Release Binaries / release (push) Failing after 7m17s

This commit is contained in:
2026-09-03 21:43:39 +02:00
parent 5974811c29
commit 78344e7677
3 changed files with 64 additions and 14 deletions
+36
View File
@@ -0,0 +1,36 @@
name: Release Binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Build Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller -r requirements.txt
- name: Compile Standalone Binaries
run: |
python package_dist.py
- name: Publish Release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
files: |
dist/*
api_key: ${{ secrets.TAG_TOKEN || github.token }}
token: ${{ secrets.TAG_TOKEN || github.token }}
+16 -14
View File
@@ -266,22 +266,24 @@ This tests invalid token rejection, encrypted socket streaming, database persist
--- ---
## Publishing Releases (Direct Binary Upload to Gitea) ## Automated Releases via Gitea Actions
Since Gitea does not have active action runners, you can compile and upload releases directly from your workstation using [`upload_release.py`](upload_release.py): Releases are automated via [`.gitea/workflows/release.yml`](.gitea/workflows/release.yml) using your Gitea action runner:
### One-Command Release Publishing ### Publishing a Release
Whenever you want to release a new version with compiled standalone binaries:
```bash ```bash
python upload_release.py --tag v1.0.0 --token <YOUR_GITEA_TOKEN> git tag v1.0.0
git push origin v1.0.0
``` ```
*(Or set `set GITEA_TOKEN=...` in your terminal and simply run `python upload_release.py --tag v1.0.0`)*
### What It Does: ### What Gitea Actions Does Automatically:
1. Calls `package_dist.py` to compile native binaries: 1. Gitea runner executes the workflow on tag push.
- `Win_Client.exe` 2. Runs `package_dist.py` to compile native standalone binaries:
- `Server.exe` - `Linux_Client.bin` (standalone binary)
- `Linux_Client.bin` - `Server.bin` (standalone server binary)
- `SHA256SUMS.txt` - `Win_Client.pyz` (standalone executable zipapp)
2. Connects to `https://gitea.eibl.tech/api/v1/repos/me0nline/LOGAR`. - `SHA256SUMS.txt` (checksums)
3. Creates the Gitea release for `v1.0.0` (or updates an existing release). 3. Publishes the Gitea release using `gitea-release-action` and attaches the compiled binary assets.
4. Uploads only the compiled binary assets as downloadable attachments.
*(Note: You can also use `upload_release.py` from your Windows machine to upload Windows `.exe` binaries directly if desired).*
+12
View File
@@ -94,6 +94,18 @@ def main():
server_script = os.path.join(OUT_DIR, "server", "Server.py") server_script = os.path.join(OUT_DIR, "server", "Server.py")
build_pyinstaller_binary(server_script, "Server.bin") build_pyinstaller_binary(server_script, "Server.bin")
# Also package standalone Windows zipapp executable
win_app_dir = os.path.join(BUILD_TEMP, "win_app")
os.makedirs(win_app_dir, exist_ok=True)
shutil.copy(os.path.join(OUT_DIR, "win_client", "Win_Client.py"), os.path.join(win_app_dir, "Win_Client.py"))
win_bin_output = os.path.join(DIST_DIR, "Win_Client.pyz")
zipapp.create_archive(
source=win_app_dir,
target=win_bin_output,
interpreter="/usr/bin/env python3",
main="Win_Client:main"
)
generate_checksums() generate_checksums()
# Clean temporary build directory # Clean temporary build directory