Maintenance Release #30
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: Deploy On Release | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
tests-and-coverage-pip: | |
name: Test & Coverage | |
uses: ./.github/workflows/reusable_test_pip.yml | |
with: | |
use_latest_pytorch_gpytorch: false | |
secrets: inherit | |
package-deploy-pypi: | |
name: Package and deploy to pypi.org | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # This is required for PyPI OIDC authentication. | |
needs: tests-and-coverage-pip | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install .[test] | |
pip install --upgrade build setuptools setuptools_scm wheel | |
- name: Build packages (wheel and source distribution) | |
run: | | |
python -m build --sdist --wheel | |
- name: Verify packages | |
run: | | |
./scripts/build_and_verify_py_packages.sh | |
- name: Deploy to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
package-deploy-conda: | |
name: Package conda and deploy to anaconda.org | |
runs-on: 8-core-ubuntu | |
needs: tests-and-coverage-pip | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
activate-environment: test | |
python-version: "3.10" | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
# avoid conda bug in >=23.10.0: https://github.com/conda/conda/issues/13412 | |
conda config --set solver classic | |
conda install -y setuptools_scm conda-build conda-verify anaconda-client | |
conda install -y scipy sphinx pytest flake8 multipledispatch | |
conda install -y -c pytorch pytorch cpuonly | |
conda install -y -c gpytorch gpytorch | |
conda install -y -c conda-forge pyro-ppl>=1.8.4 | |
conda config --set anaconda_upload no | |
- name: Build and verify conda package | |
shell: bash -l {0} | |
run: | | |
./scripts/build_and_verify_conda_package.sh | |
- name: Deploy to anaconda.org | |
shell: bash -l {0} | |
run: | | |
botorch_version=$(python -m setuptools_scm) | |
build_dir="$(pwd)/.conda/conda_build/noarch" | |
pkg_file="${build_dir}/botorch-${botorch_version}-0.tar.bz2" | |
anaconda -t ${{ secrets.ANACONDA_UPLOAD_TOKEN }} upload -u pytorch $pkg_file | |
publish-versioned-website: | |
name: Publish versioned website | |
needs: [package-deploy-pypi, package-deploy-conda] | |
uses: ./.github/workflows/reusable_website.yml | |
with: | |
publish_versioned_website: true | |
release_tag: ${{ github.event.release.tag_name }} | |
secrets: inherit |