Skip to content

CI/Release: verify wheel installs & imports before publish #3

CI/Release: verify wheel installs & imports before publish

CI/Release: verify wheel installs & imports before publish #3

Workflow file for this run

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 # 이미 μ˜¬λΌκ°„ 버전이면 μ‹€νŒ¨ λŒ€μ‹  κ±΄λ„ˆλœ€(μž¬μ‹€ν–‰ μ•ˆμ „)