Files
tokenizers/.github/workflows/python-release-conda.yml

133 lines
3.7 KiB
YAML

name: Python Release - Conda
on:
push:
tags:
- python-v*
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
jobs:
build_and_package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
# Conda does not support 3.11 yet.
python: ["3.7", "3.8", "3.9", "3.10"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup conda env
shell: bash -l {0}
run: |
conda install setuptools-rust
conda install -c defaults anaconda-client conda-build
- name: Extract version
shell: bash -l {0}
working-directory: ./bindings/python
run: echo "TOKENIZERS_VERSION=`python setup.py --version`" >> $GITHUB_ENV
- name: Build conda packages
shell: bash -l {0}
run: |
conda info
conda list
conda-build .github/conda --python=${{ matrix.python }}
- name: Upload to Anaconda
shell: bash -l {0}
run: |
anaconda upload `conda-build .github/conda --output` --force
build_and_package_linux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
strategy:
fail-fast: false
matrix:
python: [37, 38, 39]
include:
- python: 37
checksum: a1a7285dea0edc430b2bc7951d89bb30a2a1b32026d2a7b02aacaaa95cf69c7c
- python: 38
checksum: 935d72deb16e42739d69644977290395561b7a6db059b316958d97939e9bdf3d
- python: 39
checksum: 1ea2f885b4dbc3098662845560bc64271eb17085387a70c2ba3f29fff6f8d52f
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install miniconda
run: |
yum install -y wget openssl-devel
export FILENAME=Miniconda3-py${{ matrix.python }}_4.10.3-Linux-x86_64.sh
wget https://repo.anaconda.com/miniconda/$FILENAME
sha256sum $FILENAME | awk '$1=="${{ matrix.checksum}}"{print"good to go"}'
yum remove -y openssl-devel
bash $FILENAME -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate
- name: Show glibc information
shell: bash -l {0}
run: ldd --version
- name: Conda info
shell: bash -l {0}
run: |
source $HOME/miniconda/bin/activate
conda info
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup conda env
shell: bash -l {0}
run: |
source $HOME/miniconda/bin/activate
conda install setuptools-rust
conda install -c defaults anaconda-client conda-build
- name: Extract version
shell: bash -l {0}
working-directory: ./bindings/python
run: |
source $HOME/miniconda/bin/activate
echo "TOKENIZERS_VERSION=`python setup.py --version`" >> $GITHUB_ENV
- name: Build conda packages
shell: bash -l {0}
run: |
source $HOME/miniconda/bin/activate
conda info
conda list
conda-build .github/conda --python=${{ matrix.python }}
- name: Upload to Anaconda
shell: bash -l {0}
run: |
source $HOME/miniconda/bin/activate
anaconda upload `conda-build .github/conda --output` --force