-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the pypi release script to use github action with auth token a…
…nd (#593) update github action versions
- Loading branch information
1 parent
2901465
commit b361593
Showing
5 changed files
with
108 additions
and
208 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/ |
This file was deleted.
Oops, something went wrong.