From 5082e1ba03d2a3a7bfc4cb3285e2097609841a84 Mon Sep 17 00:00:00 2001 From: Kaze Wong Date: Wed, 16 Oct 2024 17:23:36 -0400 Subject: [PATCH] update workflow --- .github/workflows/python-publish.yml | 40 +++++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 30f2bc2f..e6191e8a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,20 +20,28 @@ jobs: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@v1.8.4 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install the project + run: uv sync --all-extras --dev + + - name: Run tests + # For example, using `pytest` + run: uv run pytest + + - name: Run build + run: uv build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.8.4 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}