Add PyPI build workflow and docs

Introduce a new GitHub Actions workflow (build-pypi.yml) to build Python Wheel and Source Distribution and upload them as release assets. Integrate the PyPI job into the release-all workflow and update .github/CI_CD_README.md to document the PyPI artifacts and the new build-pypi.yml entry. The workflow uses Python 3.13, installs build tooling, runs build_release.py, and uploads dist/* via softprops/action-gh-release.
This commit is contained in:
oop7
2026-02-08 19:39:18 +02:00
parent 04e043c689
commit 96cade3226
3 changed files with 63 additions and 2 deletions
+8 -2
View File
@@ -8,8 +8,8 @@ This repository uses GitHub Actions to automatically build and release YTSage fo
The workflows are triggered manually via the GitHub Actions "Workflow Dispatch" interface. This allows you to specify the version number explicitly (e.g., `1.0.0`) at runtime. The workflows are triggered manually via the GitHub Actions "Workflow Dispatch" interface. This allows you to specify the version number explicitly (e.g., `1.0.0`) at runtime.
### Workflows ### Workflows
- **Create All Releases** (`release-all.yml`): The master workflow. Triggering this will automatically run the Windows, Linux, and macOS builds in parallel with the version you provide. - **Create All Releases** (`release-all.yml`): The master workflow. Triggering this will automatically run the Windows, Linux, macOS, and PyPI builds in parallel with the version you provide.
- **Platform Specific**: You can also trigger `Build Windows Release`, `Build Linux Release`, or `Build macOS Release` individually if you only need updates for one OS. - **Platform Specific**: You can also trigger `Build Windows Release`, `Build Linux Release`, `Build macOS Release`, or `Build PyPI Package` individually.
### Build Process ### Build Process
1. **Setup**: Uses Python 3.13 on all platforms 1. **Setup**: Uses Python 3.13 on all platforms
@@ -54,8 +54,13 @@ The workflow creates the following files based on the platform:
- `YTSage-v{version}-arm64.app.zip` - Zipped application bundle - `YTSage-v{version}-arm64.app.zip` - Zipped application bundle
- `YTSage-v{version}-arm64.dmg` - Disk image installer - `YTSage-v{version}-arm64.dmg` - Disk image installer
#### PyPI
- `ytsage-{version}-py3-none-any.whl` - Python Wheel
- `ytsage-{version}.tar.gz` - Source Distribution
## Workflow Features ## Workflow Features
- **PyPI**: Standard Python build system (Wheel & Source)
### Multi-Platform Support ### Multi-Platform Support
- **Windows**: Uses PowerShell scripts with cx_Freeze - **Windows**: Uses PowerShell scripts with cx_Freeze
- **Linux**: Uses Bash scripts with cx_Freeze, creates AppImage, RPM, and DEB - **Linux**: Uses Bash scripts with cx_Freeze, creates AppImage, RPM, and DEB
@@ -91,6 +96,7 @@ The workflow files are located in `.github/workflows/`:
- `release-all.yml` - Master workflow that orchestrates the others - `release-all.yml` - Master workflow that orchestrates the others
- `build-windows.yml` - Windows builds logic - `build-windows.yml` - Windows builds logic
- `build-linux.yml` - Linux builds logic - `build-linux.yml` - Linux builds logic
- `build-pypi.yml` - PyPI build logic
- `build-macos.yml` - macOS builds logic - `build-macos.yml` - macOS builds logic
### Key Configuration Options ### Key Configuration Options
+49
View File
@@ -0,0 +1,49 @@
name: Build PyPI Package
on:
workflow_dispatch:
inputs:
version:
description: 'Version name for the release (e.g., 1.0.0)'
required: true
type: string
workflow_call:
inputs:
version:
description: 'Version name for the release (e.g., 1.0.0)'
required: true
type: string
permissions:
contents: write
jobs:
build-pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build PyPI package
run: |
python build_release.py
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version || github.event.inputs.version }}
files: |
dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+6
View File
@@ -29,3 +29,9 @@ jobs:
with: with:
version: ${{ inputs.version }} version: ${{ inputs.version }}
secrets: inherit secrets: inherit
release-pypi:
uses: ./.github/workflows/build-pypi.yml
with:
version: ${{ inputs.version }}
secrets: inherit