-
-
Notifications
You must be signed in to change notification settings - Fork 400
166 lines (145 loc) · 6.41 KB
/
deploy_publish.yml
File metadata and controls
166 lines (145 loc) · 6.41 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: deploy-on-release
on:
release:
types: [published]
jobs:
build-pypi:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Generating distribution archives
run: |
pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel --universal
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
build-docs:
name: build-docs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-18.04]
python-version: [3.6]
requires: [latest]
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: setup ubuntu
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
# https://github.com/actions/cache/blob/master/examples.md
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('./requirements/requirements.txt') }}-${{ hashFiles('./requirements/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: cache pip contrib
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-contrib-${{ hashFiles('./requirements/requirements-cv.txt') }}-${{ hashFiles('./requirements/requirements-ml.txt') }}-${{ hashFiles('./requirements/requirements-optuna.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-contrib-
- name: cache pip loggers
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-loggers-${{ hashFiles('./requirements/requirements-comet.txt') }}-${{ hashFiles('./requirements/requirements-mlflow.txt') }}-${{ hashFiles('./requirements/requirements-neptune.txt') }}-${{ hashFiles('./requirements/requirements-wandb.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-loggers-
- name: install dependencies
run: |
# python -m pip install --upgrade --user pip
pip install -r ./requirements/requirements.txt -r ./requirements/requirements-dev.txt -r ./requirements/requirements-cv.txt -r ./requirements/requirements-ml.txt -r ./requirements/requirements-optuna.txt -r ./requirements/requirements-comet.txt -r ./requirements/requirements-mlflow.txt -r ./requirements/requirements-neptune.txt -r ./requirements/requirements-wandb.txt -r ./requirements/requirements-profiler.txt
python --version
pip --version
pip list
shell: bash
- name: make docs
run: |
REMOVE_BUILDS=0 make check-docs
- name: commit documentation changes
env:
TAG: "${{ github.event.release.tag_name }}"
run: |
git clone https://github.com/catalyst-team/catalyst.git --branch gh-pages --single-branch gh-pages
cd gh-pages
cp -a ../builds "${{ github.event.release.tag_name }}"
# add link to new version into `versions.html`
master_version_link='<li class="toctree-l1"><a class="reference internal" href="index.html">master<\/a><\/li>'
new_version_link="\ <li class=\"toctree-l1\"><a class=\"reference internal\" href=\"${TAG}/index.html\">${TAG}<\/a><\/li>"
sed -i "/${master_version_link}/a ${new_version_link}" versions.html
# commit changes
git config --local user.email "action@ithub.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "${TAG:=update docs}" || true
- name: push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
build-docker:
runs-on: ubuntu-latest
strategy:
matrix:
catalyst_requirements: [base, all]
pytorch:
# - "1.9.0-cuda11.1-cudnn8-runtime"
- "1.9.0-cuda11.1-cudnn8-devel"
# - "1.8-cuda10.1-cudnn7-runtime"
- "1.8.1-cuda11.1-cudnn8-devel"
# - "1.7.0-cuda11.0-cudnn8-runtime"
- "1.7.0-cuda11.0-cudnn8-devel"
# - "1.3-cuda10.1-cudnn7-runtime"
- "1.3-cuda10.1-cudnn7-devel"
steps:
- uses: actions/checkout@v2
- name: Publish Docker to Docker Hub (base)
if: ${{ matrix.catalyst_requirements == 'base' }}
uses: elgohr/Publish-Docker-Github-Action@master
env:
PYTORCH_TAG: "${{ matrix.pytorch }}"
with:
name: catalystteam/catalyst
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile
tags: "${{ github.event.release.tag_name }}-pytorch-${{ matrix.pytorch }}"
- name: Publish Docker to Docker Hub ([all])
if: ${{ matrix.catalyst_requirements == 'all' }}
uses: elgohr/Publish-Docker-Github-Action@master
env:
PYTORCH_TAG: "${{ matrix.pytorch }}"
CATALYST_ALL: "1"
with:
name: catalystteam/catalyst
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile
tags: "${{ github.event.release.tag_name }}-${{ matrix.catalyst_requirements }}-pytorch-${{ matrix.pytorch }}"