Add local MCP server architecture #7
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: Build and publish release | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Verify release tag matches package version | |
| env: | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| run: | | |
| python - <<'PY' | |
| import os | |
| import re | |
| from pathlib import Path | |
| tag = os.environ["RELEASE_TAG"] | |
| match = re.fullmatch(r"v(\d+\.\d+\.\d+)", tag) | |
| source = Path("spectroview/__init__.py").read_text(encoding="utf-8") | |
| version = re.search(r'^VERSION\s*=\s*["\']([^"\']+)["\']', source, re.M) | |
| if not match or version is None or version.group(1) != match.group(1): | |
| raise SystemExit( | |
| "Release tags must be vMAJOR.MINOR.PATCH and match " | |
| "spectroview.VERSION." | |
| ) | |
| PY | |
| - name: Build and validate distributions | |
| run: | | |
| python -m pip install --upgrade build twine | |
| python -m build | |
| python -m twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| - name: Create GitHub release and attach distributions | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" dist/* \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes "The installable wheel is attached below and is used by SPECTROview's automatic updater." \ | |
| --generate-notes \ | |
| --verify-tag | |
| publish-pypi: | |
| needs: build-and-release | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/spectroview | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| - name: Publish distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |