bump: version #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| # Build Python wheels for all platforms | |
| build-wheels: | |
| name: Build wheels - ${{ matrix.os }} ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux x86_64 | |
| - os: ubuntu-latest | |
| target: x86_64 | |
| manylinux: auto | |
| # Linux aarch64 | |
| - os: ubuntu-latest | |
| target: aarch64 | |
| manylinux: auto | |
| # macOS x86_64 | |
| - os: macos-14 | |
| target: x86_64 | |
| # macOS arm64 | |
| - os: macos-latest | |
| target: aarch64 | |
| # Windows x86_64 | |
| - os: windows-latest | |
| target: x86_64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: | | |
| 3.9 | |
| 3.10 | |
| 3.11 | |
| 3.12 | |
| 3.13 | |
| 3.14 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --features python --interpreter 3.9 3.10 3.11 3.12 3.13 3.14 | |
| manylinux: ${{ matrix.manylinux || 'auto' }} | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }}-${{ matrix.target }} | |
| path: dist/*.whl | |
| # Build source distribution | |
| build-sdist: | |
| name: Build sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| # Build CLI binaries | |
| build-cli: | |
| name: Build CLI - ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| binary: fast-ebook | |
| asset: fast-ebook-linux-x86_64 | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| binary: fast-ebook | |
| asset: fast-ebook-macos-arm64 | |
| - os: macos-14 | |
| target: x86_64-apple-darwin | |
| binary: fast-ebook | |
| asset: fast-ebook-macos-x86_64 | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| binary: fast-ebook.exe | |
| asset: fast-ebook-windows-x86_64.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build CLI | |
| run: cargo build -p fast-ebook-cli --release --target ${{ matrix.target }} | |
| - name: Upload CLI binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-${{ matrix.asset }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.binary }} | |
| # Publish to PyPI | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [build-wheels, build-sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Download sdist | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: PyO3/maturin-action@v1 | |
| env: | |
| MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| with: | |
| command: upload | |
| args: --non-interactive --skip-existing dist/* | |
| # Create GitHub Release with CLI binaries | |
| github-release: | |
| name: GitHub Release | |
| needs: [build-cli, publish-pypi] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download CLI binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cli-* | |
| path: cli-binaries | |
| - name: Prepare release assets | |
| run: | | |
| mkdir -p release-assets | |
| for dir in cli-binaries/cli-*/; do | |
| asset_name=$(basename "$dir" | sed 's/^cli-//') | |
| cp "$dir"* "release-assets/$asset_name" | |
| done | |
| ls -la release-assets/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: release-assets/* |