Merge pull request #61 from awslabs/feat/ship-it-skill #13
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: Publish to PyPI | |
| on: | |
| push: | |
| tags: ['v*'] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # setuptools-scm needs full history + tags to derive the version | |
| # from the latest v* tag. Default checkout depth=1 hides them. | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Force version from tag | |
| run: | | |
| # Tag-driven CI publishing: bypass setuptools-scm's working-tree | |
| # inspection so the published version is exactly the tag, never | |
| # a dev-suffixed derivative. Required because build steps (e.g. | |
| # the frontend `npm run build:viewer`) can write into tracked | |
| # paths and trip setuptools-scm's dirty-tree detection — without | |
| # this override we ship things like 0.3.6.dev0 instead of 0.3.5. | |
| # Per setuptools-scm docs the dist-name-scoped env var is the | |
| # recommended way to do this in CI. | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LLM_EVALUATION_SYSTEM=$VERSION" >> "$GITHUB_ENV" | |
| echo "Forcing build version to $VERSION (from tag $GITHUB_REF)" | |
| - name: Build viewer frontend | |
| run: | | |
| cd frontend | |
| npm ci | |
| npm run build:viewer | |
| - name: Build Python distribution | |
| run: | | |
| python -m pip install --upgrade pip build | |
| python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |