update workflow 7 #11
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 🐍 distribution 📦 to PyPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main # Replace with your branch name | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rocker/tidyverse:4.3.2 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Install system build dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y python3-pip python3-dev build-essential libbz2-dev liblzma-dev libpcre2-dev libicu-dev libtiff5 | |
| - name: Install Python dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| pip3 install wheel setuptools twine rpy2 | |
| - name: Install R ahead package | |
| run: | | |
| Rscript -e "options(repos = c(techtonique = 'https://r-packages.techtonique.net', CRAN = 'https://cloud.r-project.org')); utils::install.packages('ahead', dependencies=TRUE)" | |
| - name: Debug R install | |
| run: | | |
| Rscript -e 'sessionInfo()' | |
| ls -l /usr/local/lib/R/library/ | |
| ls -l /usr/local/lib/R/library/methods/libs/ | |
| - name: Build distribution | |
| run: python3 setup.py sdist bdist_wheel | |
| - name: Run examples | |
| run: pip3 install . && find examples -maxdepth 2 -name "*.py" -exec python3 {} \; | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_AHEAD }} | |
| repository-url: https://upload.pypi.org/legacy/ |