chore: update python 3.8 -> 3.9 #110
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: Test & Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PACKAGE_NAME: rs_chardet | |
| PYTHON_VERSION: "3.9" # to build abi3 wheels | |
| jobs: | |
| macos: | |
| runs-on: macos-13 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| architecture: x64 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| default: true | |
| - name: Build wheels - x86_64 | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: x86_64 | |
| args: --release --out dist | |
| maturin-version: "v0.13.0" | |
| - name: Install built wheel - x86_64 | |
| run: | | |
| pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall | |
| - name: Build wheels - universal2 | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| args: --release --universal2 --out dist | |
| maturin-version: "v0.13.0" | |
| - name: Install built wheel - universal2 | |
| run: | | |
| pip install dist/${{ env.PACKAGE_NAME }}-*universal2.whl --force-reinstall | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| id: rschardet-macos | |
| name: wheels | |
| path: dist | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| target: [x64, x86] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| architecture: ${{ matrix.target }} | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| default: true | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist | |
| maturin-version: "v0.13.0" | |
| - name: Install built wheel | |
| shell: bash | |
| run: | | |
| python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| id: rschardet-windows-${{ matrix.target }} | |
| name: wheels | |
| path: dist | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [x86_64, i686] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| architecture: x64 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| manylinux: auto | |
| args: --release -i python3.9 --out dist | |
| maturin-version: "v0.13.0" | |
| before-script-linux: | | |
| echo $(which python3.9) | |
| python3.9 --version | |
| - name: Install built wheel | |
| if: matrix.target == 'x86_64' | |
| run: | | |
| pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| id: rschardet-linux-${{ matrix.target }} | |
| name: wheels | |
| path: dist | |
| linux-cross: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [aarch64, armv7] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| manylinux: auto | |
| args: --release -i python3.9 --out dist | |
| maturin-version: "v0.13.0" | |
| before-script-linux: | | |
| echo $(which python3.9) | |
| python3.9 --version | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| id: rschardet-linux-cross-${{ matrix.target }} | |
| name: wheels | |
| path: dist | |
| pypy: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-13] | |
| target: [x86_64, aarch64] | |
| python-version: | |
| - "3.9" | |
| exclude: | |
| - os: macos-13 | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: pypy${{ matrix.python-version }} | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| maturin-version: "v0.13.0" | |
| target: ${{ matrix.target }} | |
| manylinux: auto | |
| args: --release --out dist -i pypy${{ matrix.python-version }} | |
| - name: Install built wheel | |
| if: matrix.target == 'x86_64' | |
| run: | | |
| pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| id: rschardet-pypi-${{ matrix.os }}-${{ matrix.target }} | |
| name: wheels | |
| path: dist | |
| 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: | |
| id: rschardet-sdist-${{ matrix.os }}-${{ matrix.target}} | |
| name: wheels | |
| path: dist | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| needs: | |
| - macos | |
| - windows | |
| - linux | |
| - linux-cross | |
| - pypy | |
| - sdist | |
| # if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Display structure of artifacts | |
| run: ls -R dist | |
| # - name: Publish package distributions to PyPI | |
| # uses: pypa/gh-action-pypi-publish@release/v1 |