Update the Cromwell example #1164
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: Package | |
| on: | |
| # Building on pull-requests, manual dispatch, and pushes to main. But restricting | |
| # publishing only to main pushes and manual dispatch with `if`s in specific steps | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| package: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| # Needed until setup-python's image contains a PEP625-compliant setuptools | |
| - name: Upgrade setuptools | |
| run: pip install --upgrade 'setuptools>=69.3.0' | |
| - name: Build | |
| run: python setup.py sdist | |
| - name: Test install | |
| run: pip install dist/* | |
| - name: Run tests | |
| run: python -m unittest test/test_analysis_runner.py | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/* | |
| retention-days: 2 | |
| upload_pypi: | |
| needs: package | |
| if: ${{ github.event_name != 'pull_request' }} | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| # `skip_existing: true` makes sure that the package will be published | |
| # only when new version is created | |
| - name: Publish the wheel to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true |