fix: serve Namespace and lazy-import bugs; add CLI smoke and seam tes… #342
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 and PyPI Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release-and-publish: | |
| runs-on: ubuntu-latest | |
| concurrency: release | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.ADMIN_TOKEN }} | |
| - name: Check if should skip | |
| id: check_skip | |
| run: | | |
| if [ "$(git log -1 --pretty=format:'%an')" = "OpenAdapt Bot" ]; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Set up Python | |
| if: steps.check_skip.outputs.skip != 'true' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| if: steps.check_skip.outputs.skip != 'true' | |
| run: pip install poetry | |
| - name: Python Semantic Release | |
| if: steps.check_skip.outputs.skip != 'true' | |
| id: release | |
| uses: python-semantic-release/python-semantic-release@v10.5.3 | |
| with: | |
| github_token: ${{ secrets.ADMIN_TOKEN }} | |
| git_committer_name: "OpenAdapt Bot" | |
| git_committer_email: "bot@openadapt.ai" | |
| - name: Build and publish to PyPI | |
| if: steps.check_skip.outputs.skip != 'true' && steps.release.outputs.released == 'true' | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| run: | | |
| git pull | |
| poetry config pypi-token.pypi $PYPI_TOKEN | |
| poetry build | |
| poetry publish --no-interaction --skip-existing | |
| # Releases in openadapt-ml failed silently for 3 months (Mar-Jun | |
| # 2026) while PyPI went stale; see issue #999. Fail loudly instead. | |
| - name: File issue on release failure | |
| if: failure() | |
| env: | |
| GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} | |
| run: | | |
| TITLE="Release workflow failed on main" | |
| BODY="The release workflow failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| Until this is fixed, merged fix/feat commits are NOT being published to PyPI, and users install stale versions." | |
| EXISTING=$(gh issue list --repo "${{ github.repository }}" --state open --search "in:title \"$TITLE\"" --json number --jq '.[0].number // empty') | |
| if [ -n "$EXISTING" ]; then | |
| gh issue comment "$EXISTING" --repo "${{ github.repository }}" --body "$BODY" | |
| else | |
| gh issue create --repo "${{ github.repository }}" --title "$TITLE" --body "$BODY" | |
| fi |