Update usage example in README and clean up unrolled.py #6
This file contains hidden or 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: Publish Python 🐍 distributions 📦 to PyPI | |
| on: | |
| push: | |
| branches: [ main ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| pypi-publish: | |
| # Only run publishing when the commit message contains [bumpversion] | |
| if: "contains(github.event.head_commit.message, '[bumpversion]')" | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/meddlr | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| env: | |
| commitmsg: ${{ github.event.head_commit.message }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - uses: actions/cache@v2 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip | |
| - name: Print commit message | |
| run: echo "Commit MSG = ${commitmsg}" | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install torch torchvision torchmetrics | |
| pip install twine | |
| make dev | |
| pip install -e '.[alldev]' | |
| - name: Build | |
| run: | | |
| python setup.py sdist bdist_wheel --universal | |
| twine check dist/* | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| verbose: true |