cleanup info files #178
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: Build and upload to PyPI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "*" | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| build: | |
| name: Build distribution packages π¦ | |
| if: "github.repository == 'alchemistry/alchemlyb'" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install build | |
| - name: build source and wheel distribution packages | |
| run: | | |
| python -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: "PyPI: Publish Python π distribution π¦" | |
| # only publish to PyPi for releases | |
| if: | | |
| github.repository == 'alchemistry/alchemlyb' && | |
| (github.event_name == 'release' && github.event.action == 'published') | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: deploy | |
| url: https://pypi.org/p/alchemlyb | |
| 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: | |
| verbose: true | |
| publish-to-testpypi: | |
| name: "TestPyPI: Publish Python π distribution π¦" | |
| # publish to TesPyPi for tags | |
| if: | | |
| github.repository == 'alchemistry/alchemlyb' && | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: deploy | |
| url: https://test.pypi.org/p/alchemlyb | |
| 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 TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| verbose: true | |