PyPI Nightly Build #180
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: PyPI Nightly Build | |
| on: | |
| schedule: | |
| # Run daily at 6:00 AM UTC+8 | |
| - cron: '0 22 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| publish-test-pypi: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --frozen --no-default-groups --group dev | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Install JavaScript dependencies | |
| run: cd dashboard && npm ci | |
| - name: Build dashboard | |
| run: cd dashboard && npm run build | |
| - name: Get current version | |
| id: get_version | |
| run: | | |
| VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Current version: $VERSION" | |
| - name: Create development version | |
| run: | | |
| # Create a dev version with timestamp | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| DEV_VERSION="${{ steps.get_version.outputs.version }}.dev$TIMESTAMP" | |
| echo "Creating dev version: $DEV_VERSION" | |
| ./scripts/bump_version.sh "$DEV_VERSION" | |
| - name: Build package | |
| run: | | |
| uv build | |
| - name: Publish to Test PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |