Upgrade upload/download GitHub Actions (#2517) #60
Workflow file for this run
This file contains 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: Publish | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: scripts/install | |
- name: Build package & docs | |
run: scripts/build | |
- name: Upload package distributions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package-distributions | |
path: dist/ | |
- name: Upload documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: documentation | |
path: site/ | |
pypi-publish: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
id-token: write | |
environment: | |
name: pypi | |
url: https://pypi.org/project/uvicorn | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: package-distributions | |
path: dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
docs-publish: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: documentation | |
path: site/ | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: scripts/install | |
- name: Publish documentation 📚 to GitHub Pages | |
run: mkdocs gh-deploy --force |