Add packaging. #1
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 & test | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| workflow_call: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install -U uv | |
| uv sync | |
| - name: Run tests | |
| run: | | |
| # Replace with how you run BLang tests | |
| uv run pytest . | |
| - name: Build | |
| run: | | |
| uv build | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/*.whl | |
| - name: Upload to PyPI | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| uv publish |