diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 5df230d..6232fff 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -1,4 +1,4 @@ -name: Release +name: PyPI Release on: push: @@ -10,122 +10,74 @@ permissions: contents: write jobs: - linux: - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist - sccache: 'true' - manylinux: auto - - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-linux-${{ matrix.target }}-py${{ matrix.python-version }} - path: dist - - windows: - runs-on: windows-latest + build-wheels: + name: Build wheels (${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - target: [x64] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist + python-version: '3.12' - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-windows-${{ matrix.target }}-py${{ matrix.python-version }} - path: dist - - macos: - runs-on: macos-latest - strategy: - matrix: - target: [x86_64, aarch64] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist + run: uv build --wheel --out dist - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-macos-${{ matrix.target }}-py${{ matrix.python-version }} - path: dist + name: wheels-${{ matrix.os }} + path: dist/*.whl - sdist: + build-sdist: + name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v4 + - name: Build sdist - uses: PyO3/maturin-action@v1 - with: - command: sdist - args: --out dist + run: uv build --sdist --out dist - name: Upload sdist uses: actions/upload-artifact@v4 with: - name: wheels-sdist - path: dist + name: sdist + path: dist/*.tar.gz - release: - name: Release + publish: + name: Publish to PyPI runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') - needs: [linux, windows, macos, sdist] + needs: [build-wheels, build-sdist] steps: - - uses: actions/download-artifact@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 with: - pattern: wheels-* - merge-multiple: true path: dist + merge-multiple: true + + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Publish to PyPI - uses: PyO3/maturin-action@v1 + run: uv publish dist/* env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - with: - command: upload - args: --non-interactive --skip-existing dist/* + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - name: Create GitHub Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: dist/* generate_release_notes: true diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index e8b31d5..c29c28c 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -8,11 +8,13 @@ on: jobs: build: + name: Build (${{ matrix.os }}, Python ${{ matrix.python-version }}) runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -20,14 +22,16 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install maturin - run: pip install maturin + - uses: dtolnay/rust-toolchain@stable + + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Build wheel - run: maturin build --release --features python + run: uv build --wheel --out dist - name: Upload wheel uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.os }}-py${{ matrix.python-version }} - path: target/wheels/*.whl + path: dist/*.whl diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c56f729..8de989c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo test --all-features + - run: cargo test build-binaries: name: Build Binaries @@ -147,7 +147,7 @@ jobs: path: artifacts - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: Release ${{ needs.validate.outputs.version }} draft: false diff --git a/pyproject.toml b/pyproject.toml index b852751..248e4cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -32,7 +31,7 @@ classifiers = [ "Topic :: Terminals", "Topic :: Utilities", ] -requires-python = ">=3.8" +requires-python = ">=3.9" [project.urls] Homepage = "https://github.com/muk2/feedtui"