Skip to content

Commit

Permalink
Update pypi publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinitto committed Feb 10, 2024
1 parent 9b689f2 commit 22b14f7
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- name: Checkout the commit
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -38,11 +38,40 @@ jobs:
run: |
cd $GITHUB_WORKSPACE
pytest
docs:
name: Docs
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: test
steps:
- name: Checkout the commit
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
python -m pip install --upgrade pip
python --version
pip install -r requirements.txt
- name: Deploy docs
run: mkdocs gh-deploy --force

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: test
needs: docs
environment:
name: release
url: https://pypi.org/p/pydantic-redis
permissions:
id-token: write
steps:
- name: Checkout the commit
uses: actions/checkout@v3
Expand All @@ -59,11 +88,6 @@ jobs:
python --version
pip install -r requirements.txt
- name: Build
run: |
python -m build
- name: Deploy docs
run: |
mkdocs gh-deploy --force
run: python -m build
- name: Upload to pypi
run: |
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/*
run: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 22b14f7

Please sign in to comment.