update static glib version #18
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: Build and upload python packages to Github release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- opus-release | |
tags: | |
- '*' | |
jobs: | |
build-sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: source | |
path: dist/*.tar.gz | |
build-wheels-macos: | |
runs-on: macos-12 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" | |
MINICONDA_FILENAME: Miniconda3-latest-MacOSX-x86_64.sh | |
CC: clang | |
CXX: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download and install miniconda | |
shell: bash | |
run: | | |
curl -L -o $MINICONDA_FILENAME "https://repo.continuum.io/miniconda/$MINICONDA_FILENAME" | |
bash ${MINICONDA_FILENAME} -b -f -p $HOME/miniconda3 | |
echo "::add-path::$HOME/miniconda3/bin" | |
echo "::add-path::$HOME/miniconda3/Scripts" | |
conda init | |
- name: Download and build dependencies | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda create -n meson python=3.8 | |
conda activate meson | |
conda install -y meson | |
make download-build-static-deps | |
conda deactivate | |
- name: Build and upload packages | |
run: | | |
eval "$(conda shell.bash hook)" | |
for VERSION in 3.7 3.8 3.9 3.10 3.11; do | |
conda create -n py$VERSION python=$VERSION | |
conda activate py$VERSION | |
STATIC_LIBS=1 python setup.py build_ext bdist_wheel | |
conda deactivate | |
done | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: macos-wheels | |
path: dist/*.whl | |
build-wheels-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build package and upload from docker | |
run: | | |
docker run --rm -v "${PWD}:/opt/fast-mosestokenizer" \ | |
ubuntu:22.04 /bin/bash /opt/fast-mosestokenizer/build-release-linux.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux-wheels | |
path: dist/*.whl | |
make-release: | |
runs-on: ubuntu-latest | |
needs: | |
- build-sdist | |
- build-wheels-macos | |
- build-wheels-linux | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: linux-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: macos-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: source | |
path: dist | |
- name: Upload release | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.whl | |
- name: Upload to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |