mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-08-15 16:40:26 +03:00
MacOS Wheels (#432)
* Remove trailing whitespace * Additional MacOS wheels: Wheels for python 3.6 to 3.10 with a minimum target of MacOS 10.9 * Install bergamot package from wheel directory * Remove no-index as we need dependencies
This commit is contained in:
parent
84c761bacd
commit
7f79128900
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@ -91,12 +91,12 @@ jobs:
|
|||||||
PYTHON_LOCAL_VERSION_IDENTIFIER=${{ env.PYTHON_LOCAL_VERSION_IDENTIFIER }}
|
PYTHON_LOCAL_VERSION_IDENTIFIER=${{ env.PYTHON_LOCAL_VERSION_IDENTIFIER }}
|
||||||
CCACHE_DIR=${{ env.ccache_dir }}
|
CCACHE_DIR=${{ env.ccache_dir }}
|
||||||
CCACHE_BASEDIR=${{ env.ccache_basedir }}
|
CCACHE_BASEDIR=${{ env.ccache_basedir }}
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.15
|
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||||
|
|
||||||
CIBW_BEFORE_BUILD_LINUX: |
|
CIBW_BEFORE_BUILD_LINUX: |
|
||||||
yum install -y ccache
|
yum install -y ccache
|
||||||
|
|
||||||
# Install Intel MKL.
|
# Install Intel MKL.
|
||||||
yum-config-manager -y --add-repo https://yum.repos.intel.com/mkl/setup/intel-mkl.repo
|
yum-config-manager -y --add-repo https://yum.repos.intel.com/mkl/setup/intel-mkl.repo
|
||||||
yum install -y intel-mkl
|
yum install -y intel-mkl
|
||||||
|
|
||||||
@ -106,19 +106,19 @@ jobs:
|
|||||||
ccache -z # Zero cache entry
|
ccache -z # Zero cache entry
|
||||||
|
|
||||||
CIBW_BEFORE_BUILD_MACOS: |
|
CIBW_BEFORE_BUILD_MACOS: |
|
||||||
brew install openblas protobuf ccache boost pybind11
|
brew install openblas protobuf ccache boost pybind11
|
||||||
chmod -R a+rwx ${{ env.ccache_dir }}
|
chmod -R a+rwx ${{ env.ccache_dir }}
|
||||||
ccache -s # Print current cache stats
|
ccache -s # Print current cache stats
|
||||||
ccache -z # Zero cache entry
|
ccache -z # Zero cache entry
|
||||||
|
|
||||||
CIBW_BUILD: "cp{36,37,38,39,310}-*manylinux_x86_64 cp310-macosx_x86_64"
|
CIBW_BUILD: "cp{36,37,38,39,310}-*manylinux_x86_64 cp{36,37,38,39,310}-macosx_x86_64"
|
||||||
|
|
||||||
CIBW_BEFORE_TEST: |
|
CIBW_BEFORE_TEST: |
|
||||||
ccache -s # Print current ccache stats
|
ccache -s # Print current ccache stats
|
||||||
|
|
||||||
CIBW_TEST_COMMAND: |
|
CIBW_TEST_COMMAND: |
|
||||||
# The wheels are installed automatically and available.
|
# The wheels are installed automatically and available.
|
||||||
|
|
||||||
# Fetch models from translateLocally repository.
|
# Fetch models from translateLocally repository.
|
||||||
python3 -m bergamot download -m en-de-tiny
|
python3 -m bergamot download -m en-de-tiny
|
||||||
python3 -m bergamot download -m de-en-tiny
|
python3 -m bergamot download -m de-en-tiny
|
||||||
@ -181,7 +181,7 @@ jobs:
|
|||||||
echo "CCACHE_MAXSIZE=${{ env.ccache_maxsize }}" >> $GITHUB_ENV
|
echo "CCACHE_MAXSIZE=${{ env.ccache_maxsize }}" >> $GITHUB_ENV
|
||||||
# https://emscripten.org/docs/compiling/Building-Projects.html#using-a-compiler-wrapper
|
# https://emscripten.org/docs/compiling/Building-Projects.html#using-a-compiler-wrapper
|
||||||
echo "EM_COMPILER_WRAPPER=ccache" >> $GITHUB_ENV
|
echo "EM_COMPILER_WRAPPER=ccache" >> $GITHUB_ENV
|
||||||
|
|
||||||
# This need to be run before setup, so ccache build caching doesn't complain.
|
# This need to be run before setup, so ccache build caching doesn't complain.
|
||||||
- name: Obtain emsdk sources
|
- name: Obtain emsdk sources
|
||||||
run: |
|
run: |
|
||||||
@ -265,7 +265,7 @@ jobs:
|
|||||||
npm install jsdom
|
npm install jsdom
|
||||||
|
|
||||||
# --unhandled-rejections make the script exit with a non-zero code (at least on node-14).
|
# --unhandled-rejections make the script exit with a non-zero code (at least on node-14).
|
||||||
# So leaving this here.
|
# So leaving this here.
|
||||||
node --unhandled-rejections=strict node-test.js
|
node --unhandled-rejections=strict node-test.js
|
||||||
|
|
||||||
# Upload both together.
|
# Upload both together.
|
||||||
@ -295,7 +295,7 @@ jobs:
|
|||||||
- name: List downloaded assets
|
- name: List downloaded assets
|
||||||
run: |
|
run: |
|
||||||
find ./
|
find ./
|
||||||
|
|
||||||
- name: Update GitHub prerelease
|
- name: Update GitHub prerelease
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
with:
|
with:
|
||||||
@ -307,9 +307,9 @@ jobs:
|
|||||||
wheels/*.whl
|
wheels/*.whl
|
||||||
wasm-artefacts/bergamot-translator-worker.js
|
wasm-artefacts/bergamot-translator-worker.js
|
||||||
wasm-artefacts/bergamot-translator-worker.wasm
|
wasm-artefacts/bergamot-translator-worker.wasm
|
||||||
|
|
||||||
release-version:
|
release-version:
|
||||||
name: Release version
|
name: Release version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-wheels, build-wasm]
|
needs: [build-wheels, build-wasm]
|
||||||
permissions:
|
permissions:
|
||||||
@ -325,7 +325,7 @@ jobs:
|
|||||||
- name: List downloaded assets
|
- name: List downloaded assets
|
||||||
run: |
|
run: |
|
||||||
find ./
|
find ./
|
||||||
|
|
||||||
- name: Update GitHub release
|
- name: Update GitHub release
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
with:
|
with:
|
||||||
@ -338,7 +338,7 @@ jobs:
|
|||||||
wasm-artefacts/bergamot-translator-worker.js
|
wasm-artefacts/bergamot-translator-worker.js
|
||||||
wasm-artefacts/bergamot-translator-worker.wasm
|
wasm-artefacts/bergamot-translator-worker.wasm
|
||||||
|
|
||||||
|
|
||||||
python-checks:
|
python-checks:
|
||||||
name: "formatting and typechecks"
|
name: "formatting and typechecks"
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
@ -389,8 +389,8 @@ jobs:
|
|||||||
# Patches the BERGAMOT_VERSION file used by sphinx-docs at run time to
|
# Patches the BERGAMOT_VERSION file used by sphinx-docs at run time to
|
||||||
# obtain names like 'main' or 'ci-sandbox' to not confuse with version
|
# obtain names like 'main' or 'ci-sandbox' to not confuse with version
|
||||||
# based documentation built separately.
|
# based documentation built separately.
|
||||||
- name: Deploy-time patch version
|
- name: Deploy-time patch version
|
||||||
run: |
|
run: |
|
||||||
echo ${{steps.tag.outputs.result }} > BERGAMOT_VERSION
|
echo ${{steps.tag.outputs.result }} > BERGAMOT_VERSION
|
||||||
|
|
||||||
- name: Set up Doxygen
|
- name: Set up Doxygen
|
||||||
@ -413,7 +413,7 @@ jobs:
|
|||||||
working-directory: ./doc
|
working-directory: ./doc
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -r requirements.txt
|
python3 -m pip install -r requirements.txt
|
||||||
python3 -m pip install ${{github.workspace}}/wheels/bergamot-*-cp37*.whl
|
python3 -m pip install --find-links=${{github.workspace}}/wheels bergamot
|
||||||
|
|
||||||
- name: Build documentation
|
- name: Build documentation
|
||||||
working-directory: ./doc
|
working-directory: ./doc
|
||||||
@ -424,16 +424,16 @@ jobs:
|
|||||||
uses: JamesIves/github-pages-deploy-action@4.1.3
|
uses: JamesIves/github-pages-deploy-action@4.1.3
|
||||||
if: ${{ github.event_name == 'push' && github.repository == 'browsermt/bergamot-translator' }}
|
if: ${{ github.event_name == 'push' && github.repository == 'browsermt/bergamot-translator' }}
|
||||||
with:
|
with:
|
||||||
repository-name: 'browsermt/docs'
|
repository-name: 'browsermt/docs'
|
||||||
branch: gh-pages # The branch the action should deploy to.
|
branch: gh-pages # The branch the action should deploy to.
|
||||||
folder: './doc/build/' # The folder the action should deploy.
|
folder: './doc/build/' # The folder the action should deploy.
|
||||||
target-folder: '${{ steps.tag.outputs.result }}'
|
target-folder: '${{ steps.tag.outputs.result }}'
|
||||||
ssh-key: ${{ secrets.BERGAMOT_SSH_PRIVATE_KEY }}
|
ssh-key: ${{ secrets.BERGAMOT_SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
# This artifact contains the HTML output of Sphinx only.
|
# This artifact contains the HTML output of Sphinx only.
|
||||||
# With index.html at the root of the produced zip file.
|
# With index.html at the root of the produced zip file.
|
||||||
# For use for maintainers to download the zip and check render of
|
# For use for maintainers to download the zip and check render of
|
||||||
# documentation while generated at pull-request.
|
# documentation while generated at pull-request.
|
||||||
- name: Upload documentation
|
- name: Upload documentation
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: ${{ github.event_name == 'pull_request'}}
|
if: ${{ github.event_name == 'pull_request'}}
|
||||||
@ -441,4 +441,3 @@ jobs:
|
|||||||
name: api-docs
|
name: api-docs
|
||||||
path: ./doc/build/
|
path: ./doc/build/
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user