testing #180
Workflow file for this run
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: Create and publish pypi image | |
| on: | |
| # only runs when there is a new published release | |
| # and for testing, pull requests to develop and main | |
| # and if there are changes to the build process and github action | |
| release: | |
| types: [published] | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| - dev_pypipatch | |
| paths: | |
| - 'setup.py' | |
| - 'pyproject.toml' | |
| - '.github/workflows/pypi*' | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| - 'rc*' | |
| jobs: | |
| create-pypi-image: | |
| name: >- | |
| Create .whl 🛞 from SHARPy distribution | |
| runs-on: ubuntu-22.04 | |
| env: | |
| python-version-chosen: "3.10.8" | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.python-version-chosen }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.python-version-chosen }} | |
| - name: Set up GCC | |
| uses: egor-tensin/setup-gcc@v1 | |
| with: | |
| version: 9 | |
| platform: x64 | |
| - name: Pre-Install dependencies | |
| run: | | |
| export QT_QPA_PLATFORM='offscreen' | |
| sudo apt install libeigen3-dev | |
| git submodule init | |
| git submodule update | |
| - name: Install pypa/build | |
| run: >- | |
| python3 -m | |
| pip install | |
| build | |
| --user | |
| - name: Install wheel | |
| run: python3 -m pip install wheel --user | |
| - name: Install depen | |
| run: python3 -m pip install setuptools_scm | |
| - name: Build a source tarball | |
| run: PYPI_ROUTINE=TRUE python -m build --sdist | |
| - name: Build a source tarball | |
| run: PYPI_ROUTINE=TRUE python -m build --wheel | |
| - name: Find the wheel created during pip install | |
| run: | |
| python3 -m pip cache dir | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Github logs for rebug | |
| run: | | |
| echo "::group::Logs" | |
| echo ${{ github.event_name }} | |
| echo ${{ github.event.action }} | |
| echo '${{ toJson(github) }}' | |
| echo "::endgroup::" | |
| publish-to-pypi: | |
| name: >- | |
| Publish Python 🐍 distribution 📦 to PyPI | |
| if: github.event_name == 'release' && github.event.action == 'published' # only publish to PyPI on published release | |
| needs: | |
| - create-pypi-image | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/ic_sharpy # Replace <package-name> with your PyPI project name | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| # with: | |
| # path: dist/* |