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: Publish Python Package to PyPI | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| pypi-publish: | |
| name: Upload release to PyPI | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/combicode | |
| permissions: | |
| id-token: write # this is required for trusted publishing | |
| defaults: | |
| run: | |
| working-directory: ./combicode-py | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Sync shared assets into package | |
| run: | | |
| chmod +x ./scripts/sync-assets.sh | |
| ./scripts/sync-assets.sh | |
| working-directory: . # Run from root | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: python -m pip install --upgrade pip build | |
| - name: Run Tests | |
| run: | | |
| pip install ".[test]" | |
| pytest | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: ./combicode-py/dist/ |