Skip to content

Merge pull request #32 from XpressAI/fahreza/blank-page-fix #122

Merge pull request #32 from XpressAI/fahreza/blank-page-fix

Merge pull request #32 from XpressAI/fahreza/blank-page-fix #122

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: latest
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install dependencies
run: |
# Install all dependency groups needed for tests
uv sync --all-extras --all-groups
- name: Run tests
run: |
uv run pytest
build-and-publish:
needs: test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: latest
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Extract version from tag
id: get_version
run: |
# Extract tag name from github.ref (e.g., 'refs/tags/v1.2.3' -> 'v1.2.3')
TAG=${GITHUB_REF#refs/tags/}
# Remove 'v' prefix if present (e.g., 'v1.2.3' -> '1.2.3')
VERSION=${TAG#v}
# Set output for use in later steps
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Extracted version: $VERSION"
- name: Update version in pyproject.toml
run: |
# Use sed to replace the version line in pyproject.toml
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
echo "Updated pyproject.toml with version $VERSION"
cat pyproject.toml | grep version
- name: Build package
run: |
uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/