Nightly #442
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
name: Nightly | |
on: | |
workflow_dispatch: # Allow manual triggers | |
schedule: | |
- cron: 0 0 * * * | |
jobs: | |
build: | |
if: github.repository == 'sony/model_optimization' # Don't do this in forks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Python 3 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install twine | |
- name: Build nightly | |
run: | | |
version=$(python -c 'import model_compression_toolkit; print(model_compression_toolkit.__version__)') | |
now=$(date +'%Y%m%d.%H%M%S') | |
echo "nightly_version=$version.$now" >> $GITHUB_ENV | |
sed -i "s/__version__ =.*/__version__ = \"$version.$now\"/g" model_compression_toolkit/__init__.py | |
sed -i "s/name='model_compression_toolkit'/name='mct-nightly'/g" setup.py | |
python setup.py sdist bdist_wheel | |
- name: Publish nightly | |
run: | | |
twine upload --repository pypi dist/* --verbose -u __token__ -p ${{ secrets.PYPI_API_KEY }} | |
- name: Post publish import test | |
run: | | |
pip install mct-nightly tensorflow torch | |
version=$(python -c 'import model_compression_toolkit; print(model_compression_toolkit.__version__)') | |
echo $version |