forked from pytorch/botorch
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (122 loc) · 4.13 KB
/
deploy_on_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Deploy On Release
on:
release:
types: [created]
workflow_dispatch:
jobs:
tests-and-coverage-pip:
name: Tests and coverage (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: [3.7, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install (auto-install dependencies)
run: |
pip install .[test]
- name: Unit tests and coverage
run: |
pytest -ra --cov=. --cov-report term-missing
- name: Upload coverage
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.7 }}
run: |
bash <(curl -s https://codecov.io/bash)
package-deploy-pypi:
name: Package and deploy to pypi.org
runs-on: ubuntu-latest
needs: tests-and-coverage-pip
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- 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@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
package-deploy-conda:
name: Package conda and deploy to anaconda.org
runs-on: ubuntu-latest
needs: tests-and-coverage-pip
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: test
python-version: "3.7"
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y setuptools_scm conda-build conda-verify anaconda-client
conda install -y -c pytorch pytorch cpuonly
conda install -y scipy sphinx pytest flake8
conda install -y -c gpytorch gpytorch
conda install -y -c conda-forge pyro-ppl>=1.8.0
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 setup.py --version)
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
runs-on: ubuntu-latest
needs: [package-deploy-pypi, package-deploy-conda]
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
# there may not be a compatible Ax pip version, so we use the development version
run: |
pip install gpytorch
pip install .[dev]
pip install git+https://github.com/facebook/Ax.git
pip install .[tutorials]
# NOTE: nbconvert 6.4.4 is incompatible with jinja2 3.1.0.
# We can unpin this with a future release of nbconvert.
pip install beautifulsoup4 ipython nbconvert "jinja2==3.0.3"
- name: Publish latest website
env:
DOCUSAURUS_PUBLISH_TOKEN: ${{ secrets.DOCUSAURUS_PUBLISH_TOKEN }}
run: |
./scripts/publish_site.sh -d -v ${{ github.event.release.tag_name }}