CI/Release: verify wheel installs & imports before publish #3
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: Release | |
| # νκ·Έ push(v*) μ PyPI μ publish. PyPI Trusted Publishing(OIDC) μ¬μ© β API ν ν° λΆνμ. | |
| # μ¬μ μ€μ : PyPI νλ‘μ νΈ β Publishing β GitHub Actions(μ΄ repo, release.yml, environment: pypi) λ±λ‘. | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write # Trusted Publishing (OIDC) | |
| contents: read # checkout μ© β job-level permissions λ κΈ°λ³Έκ°μ 'λ체'νλ―λ‘ λͺ μ νμ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Build | |
| run: | | |
| python -m pip install --upgrade build twine | |
| python -m build | |
| python -m twine check dist/* | |
| - name: Verify wheel installs & imports (catches missing __init__.py) | |
| run: | | |
| python -m pip install --no-deps dist/*.whl | |
| python -c "import localbrain, localbrain.adapters.cli; print('import OK', localbrain.__version__)" | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true # μ΄λ―Έ μ¬λΌκ° λ²μ μ΄λ©΄ μ€ν¨ λμ 건λλ(μ¬μ€ν μμ ) |