From 96cade32267268822f374eac948959fd641adc81 Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Sun, 8 Feb 2026 19:39:18 +0200 Subject: [PATCH] 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. --- .github/CI_CD_README.md | 10 +++++-- .github/workflows/build-pypi.yml | 49 +++++++++++++++++++++++++++++++ .github/workflows/release-all.yml | 6 ++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-pypi.yml diff --git a/.github/CI_CD_README.md b/.github/CI_CD_README.md index 12ac0fd..e68969d 100644 --- a/.github/CI_CD_README.md +++ b/.github/CI_CD_README.md @@ -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. ### 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. -- **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. +- **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`, `Build macOS Release`, or `Build PyPI Package` individually. ### Build Process 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.dmg` - Disk image installer +#### PyPI +- `ytsage-{version}-py3-none-any.whl` - Python Wheel +- `ytsage-{version}.tar.gz` - Source Distribution + ## Workflow Features +- **PyPI**: Standard Python build system (Wheel & Source) ### Multi-Platform Support - **Windows**: Uses PowerShell scripts with cx_Freeze - **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 - `build-windows.yml` - Windows builds logic - `build-linux.yml` - Linux builds logic +- `build-pypi.yml` - PyPI build logic - `build-macos.yml` - macOS builds logic ### Key Configuration Options diff --git a/.github/workflows/build-pypi.yml b/.github/workflows/build-pypi.yml new file mode 100644 index 0000000..274fb34 --- /dev/null +++ b/.github/workflows/build-pypi.yml @@ -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 }} diff --git a/.github/workflows/release-all.yml b/.github/workflows/release-all.yml index c46dd44..306bbda 100644 --- a/.github/workflows/release-all.yml +++ b/.github/workflows/release-all.yml @@ -29,3 +29,9 @@ jobs: with: version: ${{ inputs.version }} secrets: inherit + + release-pypi: + uses: ./.github/workflows/build-pypi.yml + with: + version: ${{ inputs.version }} + secrets: inherit