Auto-switch browser auth to headless over SSH #10
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 PyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: python -m pip install --upgrade build twine | |
| - name: Install package and test dependencies | |
| run: python -m pip install -e . | |
| - name: Verify tag matches package version | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PACKAGE_VERSION="$(python -c "import tomllib, pathlib; data = tomllib.loads(pathlib.Path('pyproject.toml').read_text()); print(data['project']['version'])")" | |
| test "$TAG_VERSION" = "$PACKAGE_VERSION" | |
| - name: Run tests | |
| run: python -m unittest tests/test_cli.py tests/test_mcp_server.py tests/test_service.py | |
| - name: Build distributions | |
| run: python -m build | |
| - name: Check distributions | |
| run: python -m twine check dist/* | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| path: dist/ | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/agent-labbook | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |