v0.8.1 #26
Workflow file for this run
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
# Publish archives to PyPI and TestPyPI using GitHub Actions | |
name: Publish to PyPI | |
# Only run for pushes to the main branch and releases. | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
publish-pypi: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
if: github.repository == 'kanglcn/moraine' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
shell: bash | |
run: | | |
set -ux | |
python -m pip install --upgrade pip | |
pip install -Uq nbdev | |
pip install -e ".[dev]" | |
- name: Build source and wheel distributions | |
run: | | |
python setup.py sdist bdist_wheel | |
echo "" | |
echo "Generated files:" | |
ls -lh dist/ | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@v1.6.1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |