Skip to content

ci: update PyPI publish token secret from PYPI_TOKEN to PYPI_PASSWORD #367

ci: update PyPI publish token secret from PYPI_TOKEN to PYPI_PASSWORD

ci: update PyPI publish token secret from PYPI_TOKEN to PYPI_PASSWORD #367

Workflow file for this run

name: Build and Deploy
on:
push:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync
- name: Install lint tools
run: uv pip install flake8 mypy typing_extensions
- name: Run mypy type checking
run: uv run mypy -p pipda
- name: Run flake8
run: uv run flake8 pipda
- name: Test with pytest
run: uv run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v7
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
if: matrix.python-version == 3.12
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: .coverage.xml
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Publish to PyPI
run: uv build && uv publish --token ${{ secrets.PYPI_PASSWORD }}
if: success()