bump version -> 0.6.8 #98
Workflow file for this run
This file contains 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: Python Packages | |
on: | |
push: | |
branches: [ develop ] | |
tags: [ "v*" ] | |
# following two lines must be commented out before merging, we don't want to run this on PRs | |
# but for testing this we run this on PRs | |
# pull_request: | |
# branches: [ develop ] | |
jobs: | |
build-sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools setuptools-rust | |
- name: Build | |
working-directory: ./python | |
run: bash build-sdist.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: python/dist/* | |
build-linux-wheels: | |
name: Build Linux Python Wheels (+PGO) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download dictionary | |
run: bash fetch_dictionary.sh | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: eiennohito/gha-manylinux-build@master | |
with: | |
script: python/build-wheels-manylinux-pgo.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: python/dist/*manylinux* | |
build-non-linux-wheels: | |
name: Build wheels on ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macOS-latest] | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install -U setuptools setuptools_rust wheel | |
- name: Add aarch64 target for Rust | |
run: rustup target add aarch64-apple-darwin | |
if: startsWith(matrix.os, 'macOS') | |
- name: build wheel | |
run: | | |
cd python && python setup.py bdist_wheel | |
env: | |
ARCHFLAGS: -arch x86_64 -arch arm64 | |
MACOSX_DEPLOYMENT_TARGET: 10.12 | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: python/dist/*.whl | |
upload-to-pypi: # run only if all have succeeded | |
needs: [ build-sdist, build-non-linux-wheels, build-linux-wheels ] | |
# https://stackoverflow.com/questions/58475748/github-actions-how-to-check-if-current-push-has-new-tag-is-new-release | |
if: startsWith(github.ref, 'refs/tags/v') # only for tags | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact # default artifact name | |
path: dist/ | |
- name: List files to upload | |
run: ls -R dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.PYPI_USERNAME }} | |
password: ${{ secrets.PYPI_PASSWORD }} | |
verbose: true |