-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add release scripts for responsibleai-text and responsibleai-vision p…
…ypi packages
- Loading branch information
1 parent
058814a
commit b0d7da3
Showing
2 changed files
with
177 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Release responsibleai-text to PyPI | ||
|
||
# trigger manually only ("collaborator" or more permissions required) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: "Test or Prod PyPI?" | ||
required: true | ||
default: "Test" | ||
|
||
jobs: | ||
release-error-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: fail if Test nor Prod | ||
if: ${{ ! (github.event.inputs.type == 'Test' || github.event.inputs.type == 'Prod') }} | ||
run: | | ||
echo "Only Test or Prod can be used." | ||
exit 1 | ||
# build wheel | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: 3.7 | ||
|
||
- name: Install pytorch | ||
shell: bash -l {0} | ||
run: | | ||
conda install --yes --quiet pytorch torchvision captum 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 requirements.txt for responsibleai-text | ||
shell: bash -l {0} | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
working-directory: responsibleai_text | ||
|
||
- name: Setup spacy | ||
shell: bash -l {0} | ||
run: | | ||
python -m spacy download en_core_web_sm | ||
- name: pip freeze | ||
run: pip freeze | ||
|
||
- name: build wheel for responsibleai-text | ||
shell: bash -l {0} | ||
run: python setup.py sdist bdist_wheel | ||
working-directory: responsibleai_text | ||
|
||
# run tests before publishing to PyPI | ||
|
||
- name: install responsibleai-text wheel locally | ||
shell: bash -l {0} | ||
run: find ./dist/ -name '*.whl' -exec pip install {} \; | ||
working-directory: responsibleai_text | ||
|
||
- name: run responsibleai-text tests | ||
shell: bash -l {0} | ||
run: pytest ./tests/ | ||
working-directory: responsibleai_text | ||
|
||
# publish to PyPI | ||
- name: Publish responsibleai-text package to Test PyPI | ||
if: ${{ github.event.inputs.type == 'Test' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN_RESPONSIBLEAI_TEXT }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
packages_dir: responsibleai_text/dist/ | ||
- name: Publish responsibleai-text package to PyPI | ||
if: ${{ github.event.inputs.type == 'Prod' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN_RESPONSIBLEAI_TEXT }} | ||
packages_dir: responsibleai_text/dist/ |
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,89 @@ | ||
name: Release responsibleai-vision to PyPI | ||
|
||
# trigger manually only ("collaborator" or more permissions required) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: "Test or Prod PyPI?" | ||
required: true | ||
default: "Test" | ||
|
||
jobs: | ||
release-error-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: fail if Test nor Prod | ||
if: ${{ ! (github.event.inputs.type == 'Test' || github.event.inputs.type == 'Prod') }} | ||
run: | | ||
echo "Only Test or Prod can be used." | ||
exit 1 | ||
# build wheel | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: 3.7 | ||
|
||
- name: Install pytorch | ||
shell: bash -l {0} | ||
run: | | ||
conda install --yes --quiet pytorch torchvision captum 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 requirements.txt for responsibleai-vision | ||
shell: bash -l {0} | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
working-directory: responsibleai_vision | ||
|
||
- name: Install automl dependencies | ||
shell: bash -l {0} | ||
run: | | ||
pip install -r requirements-automl.txt | ||
working-directory: responsibleai_vision | ||
|
||
- name: pip freeze | ||
run: pip freeze | ||
|
||
- name: build wheel for responsibleai-vision | ||
shell: bash -l {0} | ||
run: python setup.py sdist bdist_wheel | ||
working-directory: responsibleai_vision | ||
|
||
# run tests before publishing to PyPI | ||
|
||
- name: install responsibleai-vision wheel locally | ||
shell: bash -l {0} | ||
run: find ./dist/ -name '*.whl' -exec pip install {} \; | ||
working-directory: responsibleai_vision | ||
|
||
- name: run responsibleai-vision tests | ||
shell: bash -l {0} | ||
run: pytest ./tests/ | ||
working-directory: responsibleai_vision | ||
|
||
# publish to PyPI | ||
- name: Publish responsibleai-vision package to Test PyPI | ||
if: ${{ github.event.inputs.type == 'Test' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN_RESPONSIBLEAI_VISION }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
packages_dir: responsibleai_vision/dist/ | ||
- name: Publish responsibleai-vision package to PyPI | ||
if: ${{ github.event.inputs.type == 'Prod' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN_RESPONSIBLEAI_VISION }} | ||
packages_dir: responsibleai_vision/dist/ |