-
Notifications
You must be signed in to change notification settings - Fork 85
100 lines (84 loc) · 3.09 KB
/
release-interpret-community.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
name: Release interpret-community to PyPI
# trigger manually only ("collaborator" or more permissions required)
on:
workflow_dispatch:
inputs:
releaseType:
description: "Test or Prod PyPI?"
required: true
default: "Test"
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: fail if Test nor Prod
if: ${{ ! (github.event.inputs.releaseType == 'Test' || github.event.inputs.releaseType == 'Prod') }}
run: |
echo "Only Test or Prod can be used."
exit 1
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: 3.8
- name: Install pytorch on non-MacOS
shell: bash -l {0}
run: |
conda install --yes --quiet pytorch torchvision cpuonly -c pytorch
- name: update and upgrade pip, setuptools, wheel, and twine
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Install dev dependencies
shell: bash -l {0}
run: |
pip install -r requirements-dev.txt
- name: Install visualization dependencies
shell: bash -l {0}
# install scikit-learn to workaround raiwidgets dependency
run: |
pip install raiwidgets
pip install -r requirements-vis.txt
pip install --upgrade scikit-learn
pip install --upgrade "shap<=0.44.0"
- name: Install test dependencies
shell: bash -l {0}
run: |
pip install -r requirements-test.txt
- name: pip freeze
shell: bash -l {0}
run: pip freeze
- name: build wheel for interpret-community
shell: bash -l {0}
run: python setup.py sdist bdist_wheel
working-directory: python
# run tests before publishing to PyPI
- name: install interpret-community wheel locally
shell: bash -l {0}
run: find ./dist/ -name '*.whl' -exec pip install {} \;
working-directory: python
- name: run interpret-community tests
shell: bash -l {0}
run: pytest ./tests -m "not notebooks" -s -v
- name: Upload a interpret-community build result
uses: actions/upload-artifact@v4
with:
name: interpret_community
path: python/dist/
# publish to PyPI
- name: Publish interpret-community package to Test PyPI
if: ${{ github.event.inputs.releaseType == 'Test' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN_INTERPRET_COMMUNITY }}
repository_url: https://test.pypi.org/legacy/
packages_dir: python/dist/
- name: Publish interpret-community package to PyPI
if: ${{ github.event.inputs.releaseType == 'Prod' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_INTERPRET_COMMUNITY }}
packages_dir: python/dist/